cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sergio_Carol
Regular Visitor

How can I get Flow to register a new user with read permissions in a sharepoint site?

I am quite new to Flow and I want that after an approval process, the user has access to a sharepoint site. How can I get Flow to register this new user with read permissions? Any help will be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Sergio_Carol 

 

Use the single quotes for getByEmail('email.com')

 

ez1.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @Sergio_Carol 

 

You can achieve this by couple of flow actions.

 

You need to use the Send an HTTP request to SharePoint flow action to get the user prinicipal id using email address.


_api/web/SiteUsers/getByEmail('useremail.com')

 

Next assign the read permissions for this user using Send an HTTP request to SharePoint

 

_api/lists/getByTitle(‘Contracts’)/items(1)/roleassignments/addroleassignment(principalid=<principalid>, ,roledefid=1073741826)

 

Please see this blog for more details:
https://sergeluca.wordpress.com/2018/05/03/assign-unique-permissions-to-a-document-with-the-new-send...

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thanks for your answer.  I tried what you indicated but still giving error. Is the syntax that I use correct?

 

The error message is:

 

{
  "status": 400,
  "message": "La expresión \"web/SiteUsers/getByEmail(SERGIO.CAROL@CATALANAOCCIDENTE.COM)\" no es válida.\r\nclientRequestId: c8961e7c-0bfc-438d-8ccf-2729f17a0429\r\nserviceRequestId: f8b3fc9e-10ed-1000-2b9f-97c69445bd5c",
  "source": "https://grupocatalanaoccidente.sharepoint.com/sites/TrabajoflexibleGCO/_api/web/SiteUsers/getByEmail...)",
  "errors": [
    "-1",
    "Microsoft.SharePoint.Client.InvalidClientQueryException"
  ]
}

Captura.JPG

Hi @Sergio_Carol 

 

Use the single quotes for getByEmail('email.com')

 

ez1.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,438)