Emailing SharePoint Group with O365 Flow (Power Automate)

Task

I came across this issue when changing from SharePoint Designer to O365 Flow (Power Automate). In SP Designer to email a SP group its easy, just select the group and it emails them. With Flow you don’t have that option, so you have to do a HTTP Get from SharePoint. This also does not require any premium actions.

Solution

Here is the overall outlook of the Flow:Capture

  • Initialize a string variable, this will contain all of the users emails within the provided SharePoint group.

Capture3

  • Add a Send an HTTP request to SharePoint
    • Site Address: You should be able to select it from the pull down
    • Method: GET
    • Uri: /_api/Web/SiteGroups/GetById(2165)/users?$select=Email
      • The Id number you can get by going to the group itself within SharePoint, it will be in the URL: /_layouts/15/people.aspx?MembershipGroupId=2165

Capture4

  • Add a Parse JSON action

2020-02-29 18_55_21-Edit your flow _ Power Automate

  • For the Content select Body from the Send an HTTP request from SharePoint

2020-02-29 18_55_55-Edit your flow _ Power Automate

  • Next for the Schema click Generate from sample then paste the below into the result and click Done
    • {
          "d": {
            "results": [
              {               
                "Email": "MyEmail@gmail.com"
              }
            ]
          }
      }

2020-02-29 18_56_41-Edit your flow _ Power Automate

  • it will then automatically populate the Schema as shown below

2020-02-29 18_59_46-Edit your flow _ Power Automate

  • Lastly add the Append to string variable
    • Name: Select the initial string variable from the beginning
    • Value: Set the value to the Parse JSON – Email and it is IMPORTANT to add a semicolon after the Email
      • NOTE: it will then automatically be wrapped by an Apply to each

2020-02-29 19_05_24-Edit your flow _ Power Automate

Semicolon Added!

2020-02-29 19_09_30-Edit your flow _ Power Automate

Done!