Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Assign approval task to a SharePoint group with Power Automate

Posted on April 17, 2022April 17, 2022 by Tom

“The approval action doesn’t allow me to assign the task to members of a SharePoint group, how should I do that in Power Automate?”


Since Power Automate is quite a new technology, it expects that it’ll work with modern data. And that includes the modern way to manage permissions on SharePoint sites. While SharePoint groups were a good way to manage groups of users in the past, it’s not the right approach anymore. SharePoint groups are being slowly replaced by Microsoft 365 groups – the groups Power Automate is designed to work with.

But there’re still many organisations using SharePoint groups, and if you belong to one of them, this post is for you.

Get the members of a SharePoint group

You can’t use a SharePoint group directly, but you can use the individual users who’re in that group, if you can extract them. As already said, Power Automate doesn’t expect that it’ll work with SharePoint groups so it doesn’t give you any action to extract the users either. That’s why you’ll need an HTTP request to SharePoint.

Add the ‘Send an HTTP request to SharePoint’ action and configure it as below:

Method: GET

Uri: _api/web/siteGroups/getByName('<SharePoint group name>')/users

Note: <…> is a placeholder, replace it with the group name including the < and >.

The response will contain an array with all the users in that SharePoint group, including their emails – the only information you need.

As already described, the easiest way to extract only specific value is to use the ‘Select’ action.

Navigate in the JSON to get the list of users, and use it as the input of the ‘Select’.

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

Switch to the text only mode, and extract only the email address for each user.

item()?['Email']

The result will be a simple array containing only the emails.

Power Automate approval SharePoint group

Assign them the task

Turn it into a semicolon separated string with the join(…) expression and use it in the approvals action.

join(body('Select'),';')
Power Automate approval SharePoint group

And that’s it, you just assigned an approval task to a SharePoint group.

Summary

If you use Power Automate together with SharePoint group(s), no matter if it’s to assign approval tasks or send emails, you’ll need an HTTP request. Power Automate doesn’t support working with SP groups, but it can work with their members. Get the group members, extract their emails, and do whatever you need.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

1 thought on “Assign approval task to a SharePoint group with Power Automate”

  1. Lee Newman says:
    March 16, 2023 at 4:40 pm

    Really helpful, thanks you!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

  • How to find Excel rows missing in SharePoint list (Power Automate)March 29, 2023
  • Check whether user exists in AAD with Power AutomateMarch 26, 2023
  • How to highlight whole SharePoint row based on calculated dateMarch 22, 2023
  • Why is your Power Automate flow running so slow?March 19, 2023
  • How to add multiple links to the Power Automate approval taskMarch 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes