Skip to main content
Community site session details

Community site session details

Session Id : 26GV8cVpJw2R5LSMIZT+ej
Power Automate - Building Flows
Unanswered

How to list all files from Sharepoint folder tree?

Like (0) ShareShare
ReportReport
Posted on 21 Sep 2022 09:21:21 by 6

Hey all,

 

Unfamiliar with Power Automate up until now, I'm trying to create a relatively basic workflow, but I'm running into a few issues.

 

What I want: 

I want to create a scheduled flow that, once every day, creates a list of all the recently created files with 'invoice' in the filename on Sharepoint, then mail that list to one of the mailboxes of the finance department.

 

What do I have so far:

Based on an example I googled, I've come up with the following so far:

I have a flow that begins with List Folder with the finance dept folder on our Sharepoint selected. This feeds into a Filter Array which does From: Body, isFolder equals False. In short, this removes all the folders and leaves only the files.

This then feeds into a Create HTML Table which lists the Path and Name of each file. This is then sent in an email.

 

The result of this is an email with a neat HTML table containing ONLY the files in the root of the folder I selected. Subfolders aren't crawled through. 

So my question is: Is there any way to list ALL the files in a Sharepoint folder tree and filter said list based on file name and/or filetype?

 

Screenshot 2022-09-21 at 11.20.38.png

 

 

 

  • mm_Jeff Profile Picture
    6 on 21 Sep 2022 at 13:56:22
    Re: How to list all files from Sharepoint folder tree?

    Thanks for the suggestions so far @Jondoesflow.

    Sadly, changing the List Folder part of the flow doesn't change anything. That command only takes the content of the toplevel folder you select, no options to go through subfolders.

     

    I think I'm getting a little closer by using Get Files (properties only) with Include Nested Items active. If I add a Filter Query of File_x0020_Type eq 'pdf' to that I get just PDF files.

    The problem I'm running into now is that I don't get all the PDF files. I get a subset even though I never specified a maximum nr of results to gather.
    Also, if I try to limit the entries to a specific folder I don't get any results anymore, even though I know there are PDF files in both the root of that specific folder as well as in a subfolder.

     

    This is the flow that results in *some* PDFs shown in the HTML table:

    Screenshot 2022-09-21 at 15.47.57 copy.png


    Anyone got any idea where I'm going wrong with this?

  • JonDoesFlow Profile Picture
    1,304 on 21 Sep 2022 at 11:58:55
    Re: How to list all files from Sharepoint folder tree?

    This thread might help you - https://powerusers.microsoft.com/t5/Building-Flows/How-to-get-a-flat-listing-of-all-files-with-path-for-all/td-p/851611

  • JonDoesFlow Profile Picture
    1,304 on 21 Sep 2022 at 11:16:23
    Re: How to list all files from Sharepoint folder tree?

    Isn't it just a matter of setting the correct place to start to filter ? i.e. at the root document level of the SharePoint site ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2