Do you need to send an email based on the membership of a SharePoint group in Power Automate?
Unfortunately, SharePoint groups don’t have an associated email address like the more modern Office group implementation.
This means you will need to get a list of your SharePoint group members and their emails. This can be done with an HTTP request to the SharePoint API.
This post will show you how to use the Send an HTTP request to SharePoint action to get the group members and then send them an email.
Get SharePoint Group Membership with HTTP Request
The first step in the process will be to use the Send an HTTP request to SharePoint action from the SharePoint connector to return an array of members.
This will return an array of members along with various data points that include the user’s email address.
Here’s how to get the group members.
- Add the Send an HTTP request to SharePoint action to your flow.
- Select the SharePoint Site Address that contains the group you want to email.
- Select GET as the Method.
_api/web/siteGroups/getByName('Your Group Name')/users
- Add the above path to the Uri field. Replace the
Your Group Namewith the name of your group. This can include space characters.
This API endpoint will return all the users in the group.
Select Email Addresses from HTTP Request Body
The HTTP action will return an array filled with a lot of data for each user.
To send an email to each user, you will only need their email address from the output. This means you will need to use a Select action to get an array that only contains the email address.
Here’s how to reduce the array to only contain the email field.
- Add the Select action from the Data Operations connector.
- Add the above expression to the From field. This is the array of group members returned from the Send an HTTP request to SharePoint action.
- Click on the Switch Map to text mode option to the right of the Map field input. This will switch the input into a single field.
- Add the above expression to the Map field. This will select only the Email field from each item in the array.
Now you will have an array that only contains email addresses. The output will look something like the above array.
Join Email Addresses
Now that you have an array with the email address, you will need to join these into a single delimited string that can be added to the To field in an email action.
This will create a comma or semicolon separated list of email addresses.
Here is how to convert the array to a delimited list of emails.
- Add the Join action from the Data Operations connector.
- Add the Output from the Select action to the From field of the Join action.
- Add a comma
;character to the Join with field.
The result will look something like the above string.
Send an Email to Group Members
Now you will be able to use the output from the Join action to send your emails.
Here’s how to send an email with the joined string.
- Add the Send an email action from the Outlook connector.
- Click on the Switch to Advanced Mode option found to the right of the To field. You will need to first click into the To field before you will see the switch button. This will switch the field to a text input mode and allow you to use the out from the Join action.
- Add the Output dynamic content from the Join action in the To field.
- Add your Subject and Body to the email action as required.
Now the email will be sent to all the members of the SharePoint group. This is a dynamic solution since as the group membership changes it will change the output of the HTTP action.
SharePoint groups don’t come with an email address that can be used to email all members of the group.
Emailing the group members with Power Automate can still be achieved in a dynamic manner by using the HTTP action to list all members.
But, further manipulation is required to get only the email address.
Hope this has helped you to send emails to your groups in a flow. Let me know in the comments!