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.
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
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...
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.
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.