get report of folders and subfolders including given access from a Sharepoint site using power query

Ani_Excel

New Member
Joined
Apr 7, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi, I am looking to create a report through power query that shows all the folders and subfolders from a sharepoint site, including the names of people I have given access to and their access rights.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You won't be able to see the names of people you have given access to and their access rights, you would have to utilize Power Automate for that. Power Query can extract folders and subfolders from a SharePoint site, but not show access to those folders unless you created complex SharePoint REST APIs at each user level
 
Upvote 0
With the "Folder.Contents" command I managed to get to the first step, getting to the folder names. But I cannot access the subfolders, nor the names of the people I have given access to.

As a separate step, when I prepare a power query with get data from sharepoint online list, I got to the subfolders and the names of the people using the "title" and "RoleAssignments.Member.Title."

I was hoping that both steps could be somehow combined by using List.Generate or so...
 
Upvote 0
How about using the Folder.Files() function then grouping the table on the "Folder Path" column?
Power Query:
let
    Source = Folder.Files("/folder/path/goes/here"),
    Folders = Table.Group(Source, {"Folder Path"}, {{"Folder", each _}}),
    Result = Table.RemoveColumns(Folders,{"Folder"})
in
    Result

I cannot provide any help on the second part as I have no experience in SharePoint. That would be great to see your solution as well. If you can retrieve the folders and users in another query then I think you can combine two queries (join) on the folder path to get the result you need.
 
Upvote 0

Forum statistics

Threads
1,223,336
Messages
6,171,525
Members
452,409
Latest member
brychu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top