cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adove
Helper III
Helper III

REST API assigning user to permissions group intermittently fails

I have a flow which almost always successfully works. The point of failure occurs during a REST API call using the 'Send an HTTP request to SharePoint'. The frustrating piece of the failure is that is only fails some of the time (~10-15%). It usually work most of the time, but when the action fails Flow doesn't flag it as a failure, but passes it through as if it were successful.

 

The API call is assigning a specific user to a specific user permissions group (as shown in the screenshot):

 

Flow_AddUserCommittedGroup.png

 

I've also added a subsequent action below this API call to send me an email with the username that was supposedly added to the permissions group. While Flow sees the API as successful and also flags the entire flow as successful, (at intermittent times) the user is NOT assigned to the group AND I also receive the email with the appropriate user's username. 

 

So, in recap, my Flow works successfully (85-90%), but when it fails there are NO failure flags. The failure happens when the username is not added to the permissions group, but Flow acts as if it did add it to the group and continues on its merry way to the end of the workflow.

 

What could cause this anomonly? 

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @adove ,

 

I have made a test using a flow which is configured likes below, it is always working properly.

 

Please check it for a reference and try again with it on your side.

1.PNG

 

Best regards,

Mabel

 

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

There is a slight difference between your body script and mine.

The prefix to your 'LoginName' is as follows:

"i:0#.f|xxxx"

 

While the previx to my 'LoginName is as follows:

'i:0#.w|xxxx'

 

Should I presume that the 'f' and the 'w' are simply variables and their actual difference is moot?

 

Plus, as I said in my inital explanation, it's not like my api doesn't work at all. The issue is that it works MOST of the time. Most of the time when I run the Flow, it works without a problem, but there are times when I run the same exact same tests and it fails for no apparent reason. The next hitch is that when it does fail (by not writing the username into the permissions group) Flow passes the action as 'acceptable', as if it actually worked, and moves on to the next action. The overview page detailing all the individual runs, which catalogs them as 'succeeded' or 'failed', logs the run as 'succeeded' even when the api doesn't actually write the username into the permissions group.

 

This inconsistency is boggling and I can't use this in production if I can't be sure the flow will actually work like its designed. I need to figure out the inconsistent behavior.

 

 

Hi @adove ,

 

I assume that the following blog could be your reference as well:

https://emadgabriel.com/2019/01/04/microsoft-flow-add-user-to-sharepoint-group/

 

Could you take a try with "i:0#.f|xxxx"?

 

Please let me know if you are still getting the same issue.

 

Best regards,

Mabel

 

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

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,138)