How to Send Email to SharePoint Group in Power Automate?

Recently, I was working with Power Automate, where I was required to send an email to a SharePoint group automatically. In Power Automate, this can be done with the help of a connector called Send an HTTP request to SharePoint, which helps to retrieve the email address of a SharePoint group.

In this tutorial, we will learn everything about “Power Automate send email to SharePoint group“. You will also get to know how to get SharePoint group members email addresses using Power Automate.

Send Email to SharePoint Group using Power Automate

In a SharePoint site, by default, a few SharePoint groups will be presented on the site, like Owners, Members, and Visitors.

But for this demo, I have created a custom SharePoint group and added a few users to the group by following the below steps:

To create a new SharePoint group, follow the below instructions:

  1. Open the SharePoint site, Click Settings -> Select Site permissions -> Then, click on the Advanced permissions settings link.
  2. Under the Permissions tab, select the Create Group -> In the Create Group page, provide a group name, Choose the permission level, and click the Create button.
  3. Then, the new SharePoint group is added.
  4. To add members: Open the created group-> Click on New menu -> Select Add users to this group -> Invite people -> Click Share.
power automate send email to sharepoint group

Now, we will create an instant cloud flow in Power Automate that will send an email to users of the above SharePoint group.

Follow the below steps:

1. Navigate to https://make.powerautomate.com to open your Power Automate home page -> Click on + Create -> Select an Instant Cloud Flow and assign a name to it -> Choose the trigger’s flow “Manually trigger the flow” and click on the Create button.

Unfortunately, SharePoint groups do not have their associated email address. So, to get a list of SharePoint group members and their emails, we need to use an HTTP request to the SharePoint API.

See also  How to get selected value from Slicer in Power BI

In the next step, we will use the “Send an HTTP request to SharePoint” to get SharePoint group members in Power Automate.

2. Add a new step and choose to Send an HTTP request to SharePoint flow action. Configure the required parameters:

  • Site Address – From the dropdown, select the SharePoint site address.
  • Method – Choose the GET method from the dropdown
  • Uri – Add the Uri field that is placed in the below code.
_api/web/sitegroups(27)/users
             [OR]
_api/web/siteGroups/getByName('Developer Group')/users

Here, we can retrieve SharePoint group member’s data with their email address by providing MembershipGroupId or the SharePoint Group name.

Where,

  1. sitegroups(27) is a MembershipGroupId.
  2. Replace ‘Developer Group‘ with the name of your SharePoint group.

To view the MembershipGroupId:

  • In the Advanced permissions settings page, open a specific SharePoint group -> In the URL, you can find MembershipGroupId.
power automate get sharepoint group members

Refer to the image below.

power automate get sharepoint group members email address

Hence, HTTP action will only return the SharePoint group members with a lot of data. So, we need to fetch each user’s email address from the given output.

3. Click on the Next step and select the Select action. Then, write the below expression in the From field.

outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']?['results']

In the Map section, use the below expression to get the email values:

item()?['Email']
power automate get sharepoint group members email address

Now, we have retrieved the array of email addresses from SharePoint group members. We need to separate the list of email addresses to use these email addresses.

4. Here, add a Compose flow action to convert the array to a delimited list of emails. Configure the below parameter:

  • Inputs: Click the field -> Select Expression -> Insert the below expression.
join(body('Select'),';')

Here, I was separating the emails with a semicolon [;] delimiter.

send email to sharepoint group

5. To send an email to the SharePoint group using Power Automate, click the Next step and select the ‘Send an Email(V2)‘ action.

  • To – Pass the output of the compose flow action.
  • Subject – Enter the Subject line for the mail.
  • Body – Enter a detailed description of the mail.
send email to sharepoint group power automate

6. Now, it’s time to Save and run the flow. Click on Save. Then, Click on Test -> Select Manually -> Click Test.

See also  Alternate Row Color in Power Apps Gallery

7. Once the flow runs successfully, it will send an email notification to the users in the SharePoint group. You can check the email in the below screenshot.

send email to sharepoint group power automate

This is how to get SharePoint group members’ email addresses in Power Automate and then send emails to the SharePoint group using Power Automate.

Send Emails to Multiple SharePoint Groups using Power Automate

In the same way, you can also send an email to multiple SharePoint groups using Power Automate.

For example, here you can see I have two SharePoint groups, like the one below, with a few members added to them.

Developer GroupTester Group
Johanna Lorenz
Lidia Holloway
Henrietta Mueller
Miriam Graham
power automate get sharepoint group members
power automate get sharepoint group members email address

Follow the steps that are mentioned in the above example to get the email addresses of the SharePoint group members [Developer Group].

1. Next, add an Initialize variable flow action to initialize the email address from the SharePoint group. Set the below details:

  • Name: Provide the name for a variable.
  • Type: Select the datatype of a variable as ‘Array.’
  • Value: Take Output of Select flow action.
power automate send email to sharepoint group

2. After that, add one more Send an HTTP request to SharePoint flow action to get members from the second SharePoint group. Ensure to provide the following details:

  • Site Address – From the dropdown, select the SharePoint site address.
  • Method – Choose the GET method from the dropdown
  • Uri – Add the Uri field that is placed in the below code.
_api/web/sitegroups(29)/users

Hence, sitegroups(29) is the MembershipGroupID for that particular group.

send email to sharepoint group power automate

3. Then, add Apply to each control loop to get the SharePoint group’s values, like members and email addresses.

  • Select an output from previous steps: Take the below insert code value.
body('Send_an_HTTP_request_to_SharePoint_2')?['d']?['results']
email to sharepoint list

4. Inside the Apply to each loop, take an Append to array variable flow action. Configure the below details:

  • Name: Select the name that is taken from the drop-down.
  • Value: Add the value that is given in the below code.
item()?['Email']
send email to sharepoint group power automate

5. Then, add a Compose flow action to join the variable of email address retrieved from the two SharePoint groups.

  • Inputs: Click Expression -> Add the below code in it.
join(union(variables('Dev Email Address'),variables('Dev Email Address')),';')
send email to sharepoint group

6. To email the group members, click the Next step and select the ‘Send an Email(V2)‘ action.

  • To – Pass the output of the compose flow action.
  • Subject – Enter the Subject line for the mail.
  • Body – Enter a detailed description of the mail.
power automate send email to group

7. Now, its time to Save and run the flow. Click on Save. Then, Click on Test -> Select Manually -> Click Test.

See also  Microsoft Power BI Card - How to use

8. Once the flow runs successfully, the SharePoint group members will receive an email notification as like displayed below.

power automate send email to sharepoint group

This is how to send emails to all members of the SharePoint group in Power Automate in Microsoft 365.

Conclusion

By following this complete tutorial, you should be able to get a SharePoint group member’s email address in Power Automate and then send emails to the SharePoint group using Power Automate.

You may also like:

  • This is very helpful, thank you for posting this. I re-created the multiple SharePoint groups flow and after running it, the follow error occurs:

    InvalidTemplate. Unable to process template language expressions for action ‘Apply_to_each_2’ at line ‘0’ and column ‘0’: ‘The template language expression ‘body(‘Parse_JSON’)?[‘value’]’ cannot be evaluated because property ‘value’ cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.’.

    I’m not sure what I did wrong since I virtually followed the above flow to the tee (except changing to local source where appropriate). I’m relatively new to Power Automate, so any help is appreciated!

  • “Steps to send an Email to SharePoint group using Microsoft Flow” is incomplete as the section is missing several steps. You don’t explain how you go from step 4 to step 5.

  • >