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.
Solved! Go to Solution.
Use the single quotes for getByEmail('email.com')
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks 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"
]
}
Use the single quotes for getByEmail('email.com')
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog