cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Add a user to multiple Sharepoint Groups

Hi All

I want to add a user to multiple SharePoint groups in different site collections in the same flow. 

 

I am able to add the user to a single SharePoint group, but one or the other REST API calls do not add the user to the group. The API calls do not fail but they do not add the user. Sometimes the first API call does not add the user, sometimes the 2nd. They both return a status code of 201 and the output looks OK in the flow run. 

 

Here is what I have, adding a single user to two different groups in two different site collections:

 

Capture.PNG 

 

Any help appreciated!

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Add a user to multiple Sharepoint Groups

Hi @v-litu-msft 

In fact I already tried using the delay in cast the request was taking too long, but it did not help.

 

I then discovered some interesting behaviour where if the user had already been added to the group but subsequently removed, when he/she is added for the 2nd/3rd/nth time, the behaviour is unpredictable. Sometimes they get added, sometimes not.

 

I was repeating my tests with the same user - add to group using flow, remove manually, re-run flow. This seems to be the cause of the issue. I am guessing its some caching or possibly a delay whilst the user is removed from the back-end.

 

I was able to prove this is the problem by testing with a different user everytime. When I use a unique user, it succeeds every time.

Thanks for the response anyway.

 

Andrew

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Add a user to multiple Sharepoint Groups

Hi @agaskelluk,

 

Could you please add a delay action between two Send HTTP request action?

For example:

Annotation 2020-07-23 135110.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Frequent Visitor

Re: Add a user to multiple Sharepoint Groups

Hi @v-litu-msft 

In fact I already tried using the delay in cast the request was taking too long, but it did not help.

 

I then discovered some interesting behaviour where if the user had already been added to the group but subsequently removed, when he/she is added for the 2nd/3rd/nth time, the behaviour is unpredictable. Sometimes they get added, sometimes not.

 

I was repeating my tests with the same user - add to group using flow, remove manually, re-run flow. This seems to be the cause of the issue. I am guessing its some caching or possibly a delay whilst the user is removed from the back-end.

 

I was able to prove this is the problem by testing with a different user everytime. When I use a unique user, it succeeds every time.

Thanks for the response anyway.

 

Andrew

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (3,829)