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

Grant Sharepoint permission to Team group - "Can not find the principal with id"

Hello,
I have a Sharepoint library that got automatically created once I created a Team: "Nico Test Team"

In Sharepoint, 3 users groups got automatically created:

 

  • Nico Test Team Owners
  • Nico Test Team Members
  • Nico Test Team Visitors

I am trying to control the permissions using a flow for "Nico Test Team Members" and came with this flow:

 

NicolasB2512_0-1656013196130.png

 

In the "Sent an HTTP request to Sharepoint - Get User ID" step, I get the PrincipalId of the "Nico Test Team Members" group. In that case it's 7.

NicolasB2512_1-1656013279212.png

NicolasB2512_2-1656013385754.png

 

However, in the "Send an HTTP request - Delete existing permission" step, I get an error message that says "can't find principalId with 7"

 

NicolasB2512_3-1656013477661.png

 

NicolasB2512_4-1656013623456.png

 

What could I possibly be doing wrong? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @NicolasB2512,

 

The Site User Id is something different than the Principal Id. 

 

SharePointCass has written a nice blog about a couple of REST API calls you can use to retrieve the correct principal id:

https://sharepointcass.com/2021/04/22/sharepoint-online-rest-apis-part-vi-permissions/

 

In your case you probably want to use the sitesgroups/getbyname method.

 

sitegroups_getbyname.png

View solution in original post

2 REPLIES 2
Expiscornovus
Super User
Super User

Hi @NicolasB2512,

 

The Site User Id is something different than the Principal Id. 

 

SharePointCass has written a nice blog about a couple of REST API calls you can use to retrieve the correct principal id:

https://sharepointcass.com/2021/04/22/sharepoint-online-rest-apis-part-vi-permissions/

 

In your case you probably want to use the sitesgroups/getbyname method.

 

sitegroups_getbyname.png

Thanks @Expiscornovus, that did the trick!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,077)