Hi fellow Power Automate veterans,
Is there a way I can use Power Automate to extract all file names from a SharePoint Document Library?
Perhaps like list in cmd where it keeps the folder path that'd be even better.
My current library structure is as follows:
My Document Library (500+ files in total)
>
ABC123.xls
ABC224.xls
ABC302.xls
...
>SubFolder 2021
2021_1.xls
2021_2.xls
...
>SubFolder 2020
2020_1.xls
2020_2.xls
...
Many thanks.
Solved! Go to Solution.
Hi @Australia,
Apologies, forgot to respond to your Path question.
Amend the uri to this please (added the FileRef field in the select) to also include the path:
_api/web/lists/getbytitle('Documents')/items?$select=FileLeafRef,FileRef
Hi @Australia,
You could use a Send an HTTP request action for this and use the REST API to retrieve the items. You can apply a select to retrieve the FileLeafRef (file name).
Below is an example of that approach
_api/web/lists/getbytitle('Documents')/items?$select=FileLeafRef
@Expiscornovus many thanks for the prompt reply!
I am just wondering if this API is free?
How do I save the results as a CSV/Excel file?
Possible to retain the folder name/path if possible?
Hi @Australia,
This is an action from the SharePoint connector (a non-premium one). The REST API is part of the SharePoint Online product, https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/complete-basic-operations-using-sharepoin....
So, no additional licensing should be needed to use both.
For a CSV you can use the Create CSV table action. Use the body/value output in the From field. You can use this expression for that:
outputs('Send_an_HTTP_request_to_SharePoint')?['body/value']
Hi @Australia,
Apologies, forgot to respond to your Path question.
Amend the uri to this please (added the FileRef field in the select) to also include the path:
_api/web/lists/getbytitle('Documents')/items?$select=FileLeafRef,FileRef
@Expiscornovus It works, marvellous! Thank you so much. Your solution helped me tremendously.
Now I need to use Power Automate Desktop to upload these files to a website. Would you be the one to ask, too? IF yes, I can open a new post. 🙂
Hi @Australia,
Great to hear that it works 🙂
I could help out with desktop flows. However, there are also a lot of other people who can help you too 😁
Just post a new thread in this section:
https://powerusers.microsoft.com/t5/Power-Automate-Desktop/bd-p/MPADesktop
Thanks @Expiscornovus . I've just posted here: Upload files to a website in a loop? - Power Platform Community (microsoft.com) 😄
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
If you are a small business ISV/Reseller, share your thoughts with our research team.
User | Count |
---|---|
26 | |
25 | |
22 | |
22 | |
12 |
User | Count |
---|---|
45 | |
33 | |
31 | |
31 | |
30 |