cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
testuserburak
Regular Visitor

Sharepoint Folder Unique Permission

Hi, I have a SharePoint site with folders in a library, each root folder will have unique permission (people from outside of the organization).

How can I add a step in flow, that when a file is created an email will be sent only to the people who have access to the folder?

I have already flow which will trigger when a file is created in the library.

1 REPLY 1
tom_riha
Super User
Super User

Hello @testuserburak ,

I'd start with the assumption that the file will inherit permissions from the folder, therefore, if you get permissions on the current file it'll be the same as the permissions on the folder.

  1. HTTP request: list permissions on the file
    1. Method: GET
    2. Uri: _api/web/lists/getByTitle('[ListName]')/items([ID])/roleassignments
  2. Parse JSON: parse the result, it'll give you dynamic content 'Principal Id' = ID of the users with access
  3. HTTP request: get user information based on the 'Principal Id'
    1. Method: GET
    2. Uri: _api/web/SiteUserInfoList/Items([Principal Id])
  4. Parse JSON: parse the result, it'll give you the user data, among them their 'EMail'
  5. Send an email to that 'EMail' address (or append them in some string variable and then send a single email to that variable all after the 'Apply to each')

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (3,799)