web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to list all files ...
Power Automate
Unanswered

How to list all files from Sharepoint folder tree?

(0) ShareShare
ReportReport
Posted on 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

 

 

 

Categories:
I have the same question (0)
  • JonDoesFlow Profile Picture
    1,304 on at

    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 ?

  • JonDoesFlow Profile Picture
    1,304 on at
  • mm_Jeff Profile Picture
    6 on at

    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?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard