“You already wrote on sharing Dataverse row with a user in Power Automate, but how can I remove access instead?”
Some time ago I published an article on sharing Dataverse rows with a user. It was an integral part of the task delegation process where you must share the main approval with the new approver, otherwise he won’t see it among his tasks.
That was just one example, a very specific one, but applicable in any similar situation. Anytime you need to share a Dataverse row, you can follow the same steps. Now it’s time for the reverse operation – how do you remove access to a specific row?
It’s again an unbound action
Similarly to sharing, access removal is among the unbound Dataverse actions. Add the action ‘Perform an unbound action’ to your flow and select ‘RevokeAccess’.
Target is then the same as in the previous article:
{
"@{string('@odata.type')}": "Microsoft.Dynamics.CRM.<table logical name>",
"<unique identifier column>: "<row id>"
}
Applying it on the Approval table it can look as below:
{
"@{string('@odata.type')}": "Microsoft.Dynamics.CRM.msdyn_flow_approval",
"msdyn_flow_approvalid": "<row id>"
}
Note: you can see that I’m using the expression string(…) to input the @data.type parameter. It’s because @ is an escape character in Power Automate and as such it’s replaced by @@ after each save making the flow “un-saveable”.
The second input, Revokee, is the user whose access should be reduced. Again, it’s similar to the sharing request, but here you just enter the participant.
{
"@{string('@odata.type')}": "Microsoft.Dynamics.CRM.systemuser",
"systemuserid": "<user id in User table>"
}
Note: it’s the id in User Dataverse table, not his Entra AD id taken from user profile!
And that’s it, using this request you’ll remove access for the user.
Summary
Permissions management in Dataverse tables is a bit more complicated than in SharePoint lists as you must know a bit of coding and understand the tables structure. But once you dig a bit deeper into the references you can include the permissions management in your Power Automate flow, let it be to add or remove access to a specific Dataverse row.
Hi
Is it possible to revoke access to everyone in one hit when you may not know who the row have been shared with to start with?
Cheers