0

I am trying to use Power Automate to delete a bunch of SharePoint site groups but it does not seem to be working. My flow is successful but the group(s) are not removed. Google results seem to be more related to removing users from groups, not removing the groups themselves.

Can anyone explain what I've done wrong with my flow action?

My knowledge of REST is very limited at this stage.

My Site group:

Text

My Flow action:

Text

The Flow output:

Text

1

Try using your flow like below. This works for me:

enter image description here

OR simply like:

enter image description here

Group Settings:

enter image description here

Notable Points:

  1. I have used endpoint like: /_api/web/sitegroups/removebyid('<group-id>'). Group ID is enclosed by single quote (').
  2. In my case I am the owner for both group and flow.
| improve this answer | |
  • 1
    Thanks Ganesh. The issue was the Group owner. It was not set to the account I was expecting. As soon as I changed it, the flow worked great. I had checked permissions everywhere but on the groups themselves! – user79408 Jun 10 at 4:56
1

You can ignore the flow output in this case, all you have to do is to remove the Headers part from your Flow action, everything else looks OK. All you need is the POST method to the _api/web/sitegroups/removebyid([id])

Note the headers accepts JSON string, but you're providing it as a JS object. Removing it altogether will make it work.

As long as you're getting Status code 200, it means your flow ran successfully and it actually deleted your group.

| improve this answer | |
  • Thanks for that. I've removed everything from the headers but after running the flow, the group still remains. – user79408 Jun 10 at 0:19
  • Can you try to create it as an instant flow (flow button for mobile), and test with the same logic? Just to make sure it's not something related to the existing flow instance or a permission thing. – Mohamed Derhalli Jun 10 at 1:08
  • I've just double checked that the user account is a site owner and created a new flow with the same result. New flow: link – user79408 Jun 10 at 1:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.