Let's POWER Automate

From no-code to low-code

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

Remove user from a SharePoint group with Power Automate flow

Posted on December 4, 2022December 4, 2022 by Tom

“My organisation still uses SharePoint groups to manage permissions, can I automatically remove user from a group with Power Automate flow?”


If you’re working with SharePoint groups, Power Automate won’t give you much help. All the actions expect that you’ll use M365 groups, that the SharePoint groups are a thing of the past. But it’s not that easy to change the whole SharePoint concept to fit such expectation. You’ve been using SP groups for some time and you’ll keep doing so. The only question is… how?

You’ll need HTTP request

If there’s no dedicated action, you need an HTTP request. It was already explained in the previous articles on adding permissions to a SharePoint group and adding user to a SharePoint group, but that was only addition. Now it’s time to do also the opposite – remove users from a group.

To remove user from a group you’ll need two pieces of information – the SharePoint group id (from the first linked article), and the user id. Once you have both the ids, you can add them into an HTTP request sent to SharePoint.

Method: POST

Uri:
_api/web/siteGroups/getById(<groupId>)/users/getById(<userId>)

Header:
{
    "X-HTTP-Method": "DELETE"
}
Power Automate remove user SharePoint group

And that’s it, that’s one less user in the SharePoint group.

Summary

Every Power Automate automation involving SharePoint group must be done via HTTP request, no matter if you want to add, list or remove user(s). In this case it’ll be a combination of three HTTP requests. Firstly, get the SharePoint group id using the group name. Secondly, get the user id using his email. Once you have this information put the final HTTP request together and send it to the SharePoint.


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 *

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!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

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.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes