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 blogPower Automate Video Tutorials

View solution in original post

3 REPLIES 3
abm
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 blogPower 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 blogPower Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (62,755)