Power Platform : Power Automate – sending email to SharePoint group (all users / members of the SharePoint group)

Background / Use Case:
- In one of our project we need to send an email to SharePoint group when new item is created in SharePoint list using Power Automate
- Since its SharePoint group we do not have email address associated it we tried to find workaround for the same
- So workaround is to send an email to users in a group – group members
High level Steps
- Get the users from SharePoint group using REST API – _api/web/sitegroups(6882)/users?$select=Email and we will use “Send an HTTP request to SharePoint” action in Power Automate
- Here, sitegroups contains the parameter – Group Member ID
- Get the Group Member ID
- We have a separate article to get / know the Group Membership ID, please have a look – Microsoft 365 : SharePoint Online – Get the Group Membership ID from UI / Fetching all the users of SharePoint group using REST API
- Once we have all the users of respective SharePoint group – we will use Outlook mail action in Power Automate
Detailed Steps
- We have created SharePoint group – Knowledge Junction
- We need to send the email to member of our SharePoint group – Knowledge Junction
- We have also created one SharePoint list – “Demo Email To SP Group”
- For demo purpose we have only kept one field – Title
- On creation of new item in this list – our Power Automate will trigger and will send an email to members of group which we created – Knowledge Junction
- Now lets move to Power Automate
- From “App Launcher” bar navigate to “Power Automate” as shown in below fig

- We will be redirecting to Power Automate
- From left pane click on “+ Create” and select “Automated cloud flow” as shown in below fig
- Specify the flow name
- Select the trigger – “When an item is created“

- Specify the “Site Address” and “List Name” as

- Next step is to get the users from group / group members
- We will use REST API – _api/web/sitegroups(6882)/users?$select=Email
- Here we have MembershipGroupId for our group is – 6882
- We have separate article for calling REST API from Power Automate, please have a look – Power Platform : Power Automate – calling SharePoint REST API

- As above REST API request is executed we will have response in JSON format as
- As we have result is in place in JSON format as shown in above fig
- We will use “Select” action to parse the JSON result and get the email addresses of users
- Add the “Select” action in our Power Automate
- In select action, in From – put the following expression
@{body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']}
- And in Map field specify following expression since we need to fetch Emails of users
item()?['Email']
- As we have all emails in output of “Select” action
- Next to join the emails using “;” to use in Outlook – we will use “Compose” field and use following expressions
- Following expression will join all the emails and separate them by “;”
join(body('Select'),';')
- Once we have “Emails” separated by “;” we will use Office 365 Outlook – “Send an email (v2)” action for sending the email as shown in below fig
- We will use “Output” of compose action
Complete Flow
Thanks for reading the article !!! Please feel free to discuss in case any issues / suggestions / thoughts / questions
HAVE A GREAT TIME AHEAD !!!
You must log in to post a comment.