Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
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.

Leave a Reply Cancel reply

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

NOW AVAILABLE:

The Ultimate Power Automate expressions cheat sheet
Spend your time thinking about what the flow should do, not how to do it!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • How to create a new SharePoint list column with Power Automate flowMay 22, 2022
  • How to combine expressions in your Power Automate flowsMay 18, 2022
  • Import Planner tasks with checklists into various buckets (Power Automate)May 15, 2022
  • How to get notified when Planner task was reassigned (Power Automate)May 11, 2022
  • How to extract value from XML using Power Automate flowMay 8, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme