cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

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

View solution in original post

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (83,065)