“I’d like to send an information email to a SharePoint (NOT M365) group, is that even possible using Power Automate?”
When you send email(s) from a Power Automate flow, you can send them only to email addresses. It can be one or more user emails, or a Microsoft 365 group, but it must be an email address. Which might be a problem if you’re still using SharePoint groups. SharePoint groups don’t have an address, and as such, you can’t send an email directly to the members of such group.
However, some organisations still rely heavily on SP groups, not only to manage access, but also to distribute notifications. How could you stick to this approach when using Power Automate? How do you send an email to a SharePoint group?
Get members of the group
As stated above, you can’t send an email directly to a SharePoint group as there’s no email address. But who has an email address are the members in this group. And that’s the solution – list all the members from a SharePoint group and send them an email.
Start by adding the ‘Send an HTTP request to SharePoint’ action with the configuration below.
Method: GET
Uri: _api/web/siteGroups/getByName('<SP group name>')/users
Note: <…> are placeholders, replace them including the < and >
Such HTTP request will return all the users in the group.
Get their email addresses
But as always with people pickers, it’ll contain more information than you need. Therefore, you should select only the email addresses using the ‘Select’ action.
Navigate in the JSON outcome of the HTTP request and take only the array with users as the input…
body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']
… and select only the email addresses. Don’t forget to switch to the Text only mode!
item()?['Email']
The output of the ‘Select’ will be an array with email addresses of all the users.
Send the email
Now, when you’ve got the email addresses, you can use them to send an email. But you probably don’t want to send one email per user in a loop. It’s much better to send a single email to all the users, which means turning the array into a list of emails.
Use the join(…) expression to add a semicolon between the emails, and use this expression as the recipient of the email.
join(body('Select'),';')
And that’s it – an email to a SharePoint group.
Summary
Sending an email to a SharePoint group from your Power Automate flow takes 3 actions. First, an HTTP request to SharePoint to extract all the users from the group. Second, select only the email addresses of the users, you’re not interested in the name, picture, etc. And third, take the list of the email addresses and send them the email.
Just be careful about the SharePoint group size. Outlook supports only 500 recipients per email, and if your groups are bigger you might need to split it into smaller groups of recipients.
Thanks for the great articles with real-world examples!
Thanks for this article. However when I follow the steps in the article, I get this error, how do I resolve it?
The ‘inputs.parameters’ of workflow operation ‘Send_an_email_(V2)’ of type ‘OpenApiConnection’ is not valid. Error details: Input parameter ’emailMessage/To’ is required to be of type ‘String/email’. The runtime value ‘”{\”abc@abc.com\”:\”\”};{\”cde@cde.com\”:\”\”};{\”efg@efg.com\”:\”\”}”‘ to be converted doesn’t have the expected format ‘string/email’.
Hello Envy,
you didn’t switch to the ‘Text only’ mode in the ‘Select’ action.
Your solutions does not work. I followed the instructions line by line and it returned an error message:
OpenApiOperationParameterTypeConversionFailed
The ‘inputs.parameters’ of workflow operation ‘Send_an_email_(V2)’ of type ‘OpenApiConnection’ is not valid. Error details: Input parameter ’emailMessage/To’ is required to be of type ‘String/email’. The runtime value ‘”{\”someone@mydomain.com\”:\”\”};{\”someoneelse@mydomain.com\”:\”\”}”‘ to be converted doesn’t have the expected format ‘string/email’.
Yes, I switched to the Text Only mode… I had to configure a Regx to filter out the colon.