Issue with changing permissions using "Send and HTTP request to SharePoint" action

Copper Contributor

Hi there! First time posting and pretty new to Power Automate.

 

Here's my situation...

 

I have a SharePoint site with a few OWNERS and number number of files that each have a UNIQUE set of users. The OWNERS can see everything, while the UNIQUE users only see content that's been shared directly with them. Each file represents a manufacturing location, so when "Jerry" visits the SharePoint site, he only sees files relevant to the location he manages. As intended, Jerry only sees the file that is related to the "FLORIDA" location. It's important to note that "Erica" also provides inputs to the FLORIDA file. To give Jerry and Erica their initial permissions, I manually went into the SharePoint "Documents" library, clicked on the FLORIDA file, went to "Manage Access" and granted "Can edit" direct access to both of them.

 

I've created a new column within the Documents library and called it "Completed?" and created a JSON "I'm done!" button within this column which initiates a Power Automate approval flow. This button is clicked by Jerry, Erica, and the rest of the UNIQUE users when they are done entering their respective data. When this button is clicked, an approval loop is initiated, and at the end, a new item is created in an "EVENT LOG" SharePoint list that indicates that a user, i.e. Jerry, is done editing the FLORIDA file, and that I have approved of his edits. To this point, everything works fine.

 

However, when the new item pops up in the EVENT LOG list, I have another flow that is automatically triggered. My goal with **this** flow is to change ONLY the file permissions of the person who CLICKS the "I'm done" button, thus preventing them from making additional edits to the FLORIDA file. So, as Jerry and Erica both start with "Can edit" permissions, when Jerry clicks the "I'm done!" button and after I approve of his edits, the intent is that only Jerry's permissions get changed to "Can view". Erica will still be able to edit until she clicks "I'm done". The flow is outlined in the 3 screenshots attached.

 

The flow is running "successfully", however, the UNIQUE user permissions are NOT being changed from "Can edit" to "Can View".

 

The Output for the first "Send an HTTP request to SharePoint" action looks as follows.

 

{ "d": { "BreakRoleInheritance": null } }

 

 

The output of the third "Send an HTTP request to SharePoint 3" action looks as follows.

 

{ "d": { "AddRoleAssignment": null } }

 

Again, I've attached 3 screenshots of the code associated with my flow that I'm having issues with. In the screenshots, you'll see some "comments" that I added for the "Send an HTTP Request to SharePoint" and the "Send an HTTP Request to SharePoint 3" actions. These comments outline some of the other iterations of code that I've tried to get this to work.

 

Please let me know if there are any other details I can share to help troubleshoot this.

 

Lastly, I leveraged much of my code associated with this flow from THIS POST by @BenFetters.

 

For reference, in the "Set Variable" action for varUserID, "d.id" code reads as follows.

{ "inputs": { "name": "varUserID", "value": "@body('Send_an_HTTP_request_to_SharePoint_2')?['d']['id']" } }

 

#1 of 3#1 of 3

#2 of 3#2 of 3

#3 of 3#3 of 3

0 Replies