Flow has an action called ‘Send an HTTP request to SharePoint’. With this action, you can call the SharePoint REST API and perform all sorts of operations.
With this API, you can get all users in a specific SharePoint Group with the following REST call,
https://<siteurl>/_api/web/sitegroups/getbyname('<groupname>')/users

Steps
- Add the 'Send an HTTP request to SharePoint' action and configure it so that you call the API as stated above.
- We need to break the list items permissions inheritance.
_api/lists/getByTitle(‘Contracts’)/items(1)/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)

Here, I have considered as a document with ID as 1 that exists in a document library.
- We need to find the user's principal id from his e-mail address.
_api/web/SiteUsers/getByEmail('[email protected]')

- Initialize variable as prinicpalID as string type with value as below
body('Send_an_HTTP_Request_to_Sharepoint_2')['d']['id']

- We need to assign the read permission to this user.
_api/lists/getByTitle(‘Contracts’)/items(1)/roleassignments/addroleassignment(principalid=<principalid>}, roledefid=1073741826)
Note
(roledefid=1073741826) : means 'read only'

You can refer below table if you want to assign different permission:

Now, the permission has been assigned to the Item for the given users.
Cheers!!

Saurav BhPosted Oct 9, 2023, 7:16 AM
Tenant.sharepoint.com/sites/_api/web/SiteGroups('5706bae4-6356-4237-95a5-d4137d36785e') ... Hello I am using this API to get the Principal ID but it's I am getting the Principal ID. Also this is a AD group. Is there a way to associate the AD group with SharePoint site for role assignment? I am trying to do it from ServiceNow. Break role inheritance is working fine. But role assignment isn't because of Principal ID, could you please suggest what is the correct endpoint?
Antonio GonzalezPosted May 12, 2021, 4:38 AM
Hello greetings and thanks to me send me this message "message": "Value was either too large or too small for an Int32.\r\nclientRequestId: ca3b7a5d-bfc7-4e9f-a7b0-1a81252611a2\r\nserviceRequestId: 450fc79f-3045-c000-08b0-2059e877de13",
vivek kumarPosted Jun 24, 2020, 1:31 AM
Getting 401 unauthorized error: 401 UNAUTHORIZEDclientRequestId: 12f42b0b-73b3-4cdc-9e23-d933789f97bf serviceRequestId: 97715f9f-00e1-9000-8b5d-a22389b028c7
vivek kumarPosted Jun 24, 2020, 1:30 AM
Uri: /_api/lists/getByTitle('FSC SOX Binder')/items(@{body('Get_item')?['ID']})/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)
Sagar PardeshiPosted May 8, 2020, 12:42 PM
Nice article to implement any user changed the item level permission using Email address
Alex DovePosted Oct 8, 2018, 11:40 AM
This is an excellent blog, but what if you wanted the check the value of the permissions BEFORE you changed it? How do you go about checking the existing list item permissions to see if they either inherit or if they are unique. Then, based on the returned value, do something with a condition. If inherent do this, but if not then do that?