Hi all,
I am creating flow fetching details of different sites owned by different owners and admins. I want to emails to different owners and admins at differnt times . how can I filter the users based on the no of ownership and send email to that particular no of owned site . To give more insite tomy requirement ., My one scenario would like , if there is 0 site aadmin and 1 owner then i want to send emails to 1 owners of respective sites . same is the case with other scenarios.
Any leads would be appreciated
Hi ,
In my Use case I have one master list having details of different sites with their primary and secondary admins and owners. They can be admin of either one site or owners of multiple sites .Either of the case it could be . I need to send 1 email only to owners (if there is no site admin for that sites ) & admins (if there is atleast one admin and 1 owner) to provide details of other admins and owners as part of our SHarePoint governance . How could this be achieved without sending multiple emails to users . How could I get unigue list of users in this case.
What do you mean about site admin? Do you mean the users who have SharePoint admin role configured in Microsoft 365?
From your information, I think you want to send email to all site owners in a specified site. If yes, you can use “Send an HTTP request to SharePoint” action to get a list of site owners and then you can send emails to them.
Since you want to send emails at different times, I create a Scheduled flow for a test.
1. add a “Send an HTTP request to SharePoint” action, select “Get” of Method, and set Uri to below(testpowerapp is my site name):
_api/Web/SiteGroups/GetByName('yoursitename Owners')/users
2. Add a Array Variable called users, using this expression:
body('Send_an_HTTP_request_to_SharePoint')['d']['results']
3. Addanother two variables:
4. Append each email into the user variable:
concat(variables('users')[variables('i')]['Email'],';')
Here is the full flow:
In the last of the flow, send email directly using the user variable(I add a compose action to check the result):
Reference:
Best regards,
Allen
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492