web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a flow to rem...
Power Automate
Answered

Creating a flow to remove & grant access to a folder in the doc library?

(1) ShareShare
ReportReport
Posted on by

I have two Lists, Submission & Review, and one document library, Repository. A folder is automatically generated within the Repository document library, with a title I composed using inputs from 3 fields, when a new entry is created in the Submission list. When Submitter changes the status of a field to "Submitted" on the Submission list, it generates an identical entry on the Review List.

 

At this point, I want to be able to remove the original submitter's access to the auto-generated folder in the Repository and grant access to Reviewer 1, Reviewer 2, and Reviewer 3. How do I accomplish this?

 

I've tried the stop sharing & grant access actions on SharePoint but I've discovered those only works for items or lists, not folder.

 

Later down the road, when the Review process have completed (Reviewer 3 has changed his review status to "Review Complete" on the Review list, I want to return access of the original submitter to the folder again).

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
    HI,
     

    o remove SharePoint folder permissions using Power Automate, you can follow these steps:

    1. Create a Flow: Start by creating a new flow in Power Automate.

    2. Trigger: Choose a trigger that suits your scenario, such as "When a file is created or modified" or "Manually trigger a flow."

    3. Send an HTTP Request to SharePoint:

      • Add the "Send an HTTP request to SharePoint" action.
      • Configure the action with the following details:
        • Site Address: The URL of your SharePoint site.
        • Method: POST
        • URI: /sites/{site-name}/_api/web/GetFolderByServerRelativeUrl('/{folder-path}')/ListItemAllFields/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)
        • Headers:
          {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose"
          }
          
    4. Remove Permissions:

      • Add another "Send an HTTP request to SharePoint" action to remove specific permissions.
      • Configure the action with the following details:
        • Site Address: The URL of your SharePoint site.
        • Method: POST
        • URI: /sites/{site-name}/_api/web/GetFolderByServerRelativeUrl('/{folder-path}')/ListItemAllFields/roleassignments/removeroleassignment(principalid={user-id}, roledefid={role-id})
        • Headers:
          {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose"
          }
          
    5. Test the Flow: Save and test your flow to ensure it works as expected.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard