Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Get SP groups permissions level with Power Automate flow

Posted on October 6, 2024October 6, 2024 by Tom

“Can I use Power Automate flow to list all SP groups on a site and identify the owners, the ones with ‘full control’ permissions level?”


As you probably know by now, Power Automate doesn’t like SharePoint groups. All the operations require an HTTP request, let it be creating a group, adding users, managing permissions, or even sending an email. And it’s no different when looking for some information about a group, in this case identifying their permissions level. Listing the groups is one thing, but how about more details, e.g. what can the group members actually do?

List the groups first

When managing SP group permissions in a flow, you always work with the PrincipalId – the user / group id related to the specific site. It’s not global, as e.g. the user Entra ID, it’s different on every site, assigned only when the user / group is used in there. As such, you should always start by listing all the groups first.

Method: GET

Uri: _api/web/siteGroups

Extract the array with the groups from the output using an expression.

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

Now, knowing all the group ids, you can continue by checking their permissions level.

Get their permissions level next

Loop through all the groups in ‘Apply to each’ and get their roles with another HTTP request.

Method: GET

Uri: _api/Web/RoleAssignments/GetByPrincipalId(<groupId>)/RoleDefinitionBindings
Power Automate SP groups permissions level

This request might fail for some of the groups, but that’s fine. Not all groups have some permissions level and it’ll return an error for them.

But for those that have some permissions, ‘Select’ the permissions level name from the result…

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

item()?['Name']
Power Automate SP groups permissions level

…store them in an object that’ll contain the group name and the permission levels using ‘Compose’ action. Since each group can have multiple permission levels, join them into a string using e.g. a semicolon as a separator…

{
    "Name": "@{item()?['Title']}",
    "Permissions": "@{join(body('Select'),';')}"
}

…and collect the responses with another ‘Compose’ after the loop. This second ‘Compose’ must be configured to run no matter whether the loop succeeded or failed…

…and it should collect the outputs from the first ‘Compose’.

outputs('Compose')

The last step is to filter away all the groups without permissions – the null values in the outputs.

The result will be all groups on the SharePoint site with their specific permissions levels.

Power Automate SP groups permissions level

Summary

As you can see, it’s possible to do a lot with SP groups in a Power Automate flow, even listing permissions level. But you must know the right http requests to call, the ones that’ll give you the desired outputs, and sometimes even combine more of them. However, once you learn more about the SharePoint REST API you can do so much more in a flow than the standard actions allow you to.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

1 thought on “Get SP groups permissions level with Power Automate flow”

  1. Pingback: From the Microsoft Power Platform blogs: SharePoint groups permissions; SharePoint list items; Power platform pipelines; Canvas app galleries - Cloudproz

Leave a Reply Cancel reply

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

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes