Hello Community,
I have created a Child workflow that is designed to grant item level Read permissions to a group. I have based my design on this blog article - Custom SharePoint Permissions Using Power Automate (compass365.com). The workflow runs, throws no errors, but doesn't grant the permissions. I will share all code and run reports below. Has anyone else ever seen this issue? If so, in your answer please share guidance and code examples. - Thanks!
body('HTTP_-_Get_Principle_ID')
body('HTTP_-_Get_Principle_ID')?['d']?['Id']
body('HTTP_-_Get_Role_ID')
_api/lists/getByTitle('My List')/roleAssignments/addRoleAssignment(PrincipalId=17,roleDefId=1073741826)"
Solved it, and it was totally an oversight!
Here is my original code in the "Send an HTTP - Grant List Item Permission" action:
Here is the correct code in the "Send an HTTP - Grant List Item Permission" action:
Notice the one small difference? I had left out the "items()" flag, therefor, no error, and no permission change!
Thanks to all for your contributions.
Hey FL Mike,
Thanks for your quick response, your help is greatly appreciated. To answer some of your questions:
Here is all the output from the Send an HTTP - Grant List Item Permission step:
Raw Outputs:
Parameters:
{ "dataset": "https://mycorp.sharepoint.com/sites/mysite", "parameters/method": "POST", "parameters/uri": "_api/lists/getByTitle('Directors Migration Dashboard')/roleAssignments/addRoleAssignment(PrincipalId=17,roleDefId=1073741826)" }
Outputs - Raw:
Hi @tsmolskow
Its very hard to ask if someone has seen the issue, when we dont know what the issue is.
If its not creating it then
1) its trying but cannot and you don't capture the error or it doesn't create one
2) the flow doesn't even try
Either way it means there's a bug in the Flow that we need to find, not try to fix why you think it skipped it 🙂 don't jump to conclusions heheheh
Questions
1. Have you looked at a run when it didnt seem to grant the permission, look at the action and verify that a) it ran b) it even tried to make the call c) what its output was?
That is where I would start and share that.
I would also swap from New Mode to Class Mode first.
Share that run stats and verify that it even tried the action.
Then we can put in some debug code if necessary or fix whatever is actually causing it to not do what you want (the flow not the action)
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,089
Most Valuable Professional