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

%3CLINGO-SUB%20id%3D%22lingo-sub-1963641%22%20slang%3D%22en-US%22%3EIssue%20with%20changing%20permissions%20using%20%22Send%20and%20HTTP%20request%20to%20SharePoint%22%20action%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1963641%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there!%20First%20time%20posting%20and%20pretty%20new%20to%20Power%20Automate.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20my%20situation...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20SharePoint%20site%20with%20a%20few%20OWNERS%20and%20number%20number%20of%20files%20that%20each%20have%20a%20UNIQUE%20set%20of%20users.%20The%20OWNERS%20can%20see%20everything%2C%20while%20the%20UNIQUE%20users%20only%20see%20content%20that's%20been%20shared%20directly%20with%20them.%20Each%20file%20represents%20a%20manufacturing%20location%2C%20so%20when%20%22Jerry%22%20visits%20the%20SharePoint%20site%2C%20he%20only%20sees%20files%20relevant%20to%20the%20location%20he%20manages.%20As%20intended%2C%20Jerry%20only%20sees%20the%20file%20that%20is%20related%20to%20the%20%22FLORIDA%22%20location.%20%3CSTRONG%3EIt's%20important%20to%20note%20that%20%22Erica%22%20also%20provides%20inputs%20to%20the%20FLORIDA%20file.%26nbsp%3B%3C%2FSTRONG%3ETo%20give%20Jerry%20and%20Erica%20their%20initial%20permissions%2C%20I%20manually%20went%20into%20the%20SharePoint%20%22Documents%22%20library%2C%20clicked%20on%20the%20FLORIDA%20file%2C%20went%20to%20%22Manage%20Access%22%20and%20granted%20%22Can%20edit%22%20direct%20access%20to%20both%20of%20them.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20created%20a%20new%20column%20within%20the%20Documents%20library%20and%20called%20it%20%22Completed%3F%22%20and%20created%20a%20JSON%20%22I'm%20done!%22%20button%20within%20this%20column%20which%20initiates%20a%20Power%20Automate%20approval%20flow.%20This%20button%20is%20clicked%20by%20Jerry%2C%20Erica%2C%20and%20the%20rest%20of%20the%20UNIQUE%20users%20when%20they%20are%20done%20entering%20their%20respective%20data.%20When%20this%20button%20is%20clicked%2C%20an%20approval%20loop%20is%20initiated%2C%20and%20at%20the%20end%2C%20a%20new%20item%20is%20created%20in%20an%20%22EVENT%20LOG%22%20SharePoint%20list%20that%20indicates%20that%20a%20user%2C%20i.e.%20Jerry%2C%20is%20done%20editing%20the%20FLORIDA%20file%2C%20and%20that%20I%20have%20approved%20of%20his%20edits.%20To%20this%20point%2C%20everything%20works%20fine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EHowever%3C%2FSTRONG%3E%3C%2FEM%3E%2C%20when%20the%20new%20item%20pops%20up%20in%20the%20EVENT%20LOG%20list%2C%20I%20have%20another%20flow%20that%20is%20automatically%20triggered.%20%3CSTRONG%3EMy%20goal%20with%20%3CEM%3E**this**%3C%2FEM%3E%20flow%20is%20to%20change%20ONLY%20the%20file%20permissions%20of%20the%20person%20who%20CLICKS%20the%20%22I'm%20done%22%20button%2C%20thus%20preventing%20them%20from%20making%20additional%20edits%20to%20the%20FLORIDA%20file.%20%3C%2FSTRONG%3ESo%2C%20as%20Jerry%20and%20Erica%20both%20start%20with%20%22Can%20edit%22%20permissions%2C%20when%20Jerry%20clicks%20the%20%22I'm%20done!%22%20button%20and%20after%20I%20approve%20of%20his%20edits%2C%20the%20intent%20is%20that%20only%20Jerry's%20permissions%20get%20changed%20to%20%22Can%20view%22.%20Erica%20will%20still%20be%20able%20to%20edit%20until%20she%20clicks%20%22I'm%20done%22.%26nbsp%3BThe%20flow%20is%20outlined%20in%20the%203%20screenshots%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EThe%20flow%20is%20running%20%22successfully%22%2C%20however%2C%20the%20UNIQUE%20user%20permissions%20are%20NOT%20being%20changed%20from%20%22Can%20edit%22%20to%20%22Can%20View%22.%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Output%20for%20the%20first%20%22Send%20an%20HTTP%20request%20to%20SharePoint%22%20action%20looks%20as%20follows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%7B%20%22d%22%3A%20%7B%20%22BreakRoleInheritance%22%3A%20%3CSTRONG%3Enull%3C%2FSTRONG%3E%20%7D%20%7D%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20output%20of%20the%20third%20%22Send%20an%20HTTP%20request%20to%20SharePoint%203%22%20action%20looks%20as%20follows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%20%22d%22%3A%20%7B%20%22AddRoleAssignment%22%3A%20%3CSTRONG%3Enull%3C%2FSTRONG%3E%20%7D%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAgain%2C%20I've%20attached%203%20screenshots%20of%20the%20code%20associated%20with%20my%20flow%20that%20I'm%20having%20issues%20with.%20In%20the%20screenshots%2C%20you'll%20see%20some%20%22comments%22%20that%20I%20added%20for%20the%20%22Send%20an%20HTTP%20Request%20to%20SharePoint%22%20and%20the%20%22Send%20an%20HTTP%20Request%20to%20SharePoint%203%22%20actions.%20These%20comments%20outline%20some%20of%20the%20other%20iterations%20of%20code%20that%20I've%20tried%20to%20get%20this%20to%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EPlease%20let%20me%20know%20if%20there%20are%20any%20other%20details%20I%20can%20share%20to%20help%20troubleshoot%20this.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELastly%2C%20I%20leveraged%20much%20of%20my%20code%20associated%20with%20this%20flow%20from%20%3CA%20href%3D%22https%3A%2F%2Fpowerusers.microsoft.com%2Ft5%2FPower-Automate-Community-Blog%2FPower-Automate-and-SharePoint-Permissions%2Fba-p%2F656216%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETHIS%20POST%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20reference%2C%20the%20the%20%22Set%20Variable%22%20action%20for%20varUserID%2C%20%22d.id%22%20code%20reads%20as%20follows.%3C%2FP%3E%3CP%3E%7B%20%22inputs%22%3A%20%7B%20%22name%22%3A%20%22varUserID%22%2C%20%22value%22%3A%20%22%40body('Send_an_HTTP_request_to_SharePoint_2')%5B'd'%5D%5B'id'%5D%22%20%7D%20%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20715px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238352iFD095EF9B3239F28%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22%231%20of%203%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E%231%20of%203%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20679px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238355i9012E8EC55ECF125%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22%232%20of%203%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E%232%20of%203%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20757px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238356i02F3A68B12A8FA4E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22%233%20of%203%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3E%233%20of%203%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1963641%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New 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