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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,278)