Power Automate - Add User to SharePoint Group - Not Working, when triggered more times

Brass Contributor

Dear Ladies and Gentlemen,

 

I try to add user to SharePoint group through Power Automate with object "Send an HTTP request".

 

For example through following way:

 

Method: POST

 

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

 

Headers:
{
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
}

 

Body:
{
"__metadata": {
"type": "SP.User"
},
"LoginName": "i:0#.f|membership|<userEmail>"
}

 

When I run the Power Automate first time, the user is added.

 

When I delete the user from the group and try to run the Power Automate again, the result in Power Automate is the same like in the first run. Everything looks OK, but the user is not added to the SharePoint group.

 

I have tried tho add the user with different ways and also in different tenants.

The behavior is the same. First time the user is added. After deleting the user from the group, the user is not added again.

After some waiting time, the user is added again. But after deleting the user and trying again, the next time the user is not added.

 

It looks like some blocking setting is not allowing to add the same user again. Maybe some security setting.

 

Thank you for your help.

1 Reply
I can confirm this behavior. I even added an action at the beginning of the workflow and at the end to get the group members. At the beginning, it does not show the users are in the group and at the end it shows they are. However, they are actually not getting added. There must be some type of cache after a user is removed from a group, even though the actions don't indicate that.