We are trying to use Microsoft Power automate to add a user to a sharepoint group.
We keep hitting a internal server error.
We tried the created by claims, created by email and even hardcoding a specific email but it only gives an internal server error.
Can anyone helps us identify what we are doing wrong?
KR, Manfred
Solved! Go to Solution.
Hi @MRdeJongNN
Just tried the same scenario, when I gave the group name, it didn't work so I tried with the group id and it worked. Can you please try the same by changing the API URL like the below
/_api/web/sitegroups/GetById(<groupid>)/users
Also, the body values should be without any unwanted space
{
'__metadata': { 'type': 'SP.User' },
'LoginName':'i:0#.f|membership|<UPN>'
}
Please try it out and let us know if you have any issues.
Hi @MRdeJongNN
Just tried the same scenario, when I gave the group name, it didn't work so I tried with the group id and it worked. Can you please try the same by changing the API URL like the below
/_api/web/sitegroups/GetById(<groupid>)/users
Also, the body values should be without any unwanted space
{
'__metadata': { 'type': 'SP.User' },
'LoginName':'i:0#.f|membership|<UPN>'
}
Please try it out and let us know if you have any issues.
Dear @sudharsan1985 ,
Thank you for your time. We implemented your suggested changes. Unfortunately we still get the same error message(internal server error). Any other options we could try?
KR, Manfred
Hi @MRdeJongNN
There is something fishy on the group id, are you sure the group id is 1972? Can you verify the same by navigating to the group and confirm the query string value for MembershipGroupId.
Dear @sudharsan1985 ,
Thank you for your continues effort. I looked up if I might be mistaken on the sharepoint permission groupID. But this URL tells me that the format is correct. http://www.benprins.net/2019/09/02/sharepoint-get-all-the-ids/ (last part of the blog).
Hereby my screenshot.
Hi @sudharsan1985 ,
i retyped all the code and really made sure not to have any spaces in it and also get the capitalization right and now it works!! Thank you for you effort!
KR, Manfred
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
27 | |
20 | |
10 |