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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Files from Documen...
Power Automate
Answered

Get Files from Document Library - Filter Query and/or Folder Select

(0) ShareShare
ReportReport
Posted on by 10
Trying to pull select files from a document library to make a flow efficient enough to run (thousands of files, only need ~100 pulled for comparison purposes)
 
Using Get Files Properties Only and have tried both Filter Queries and Folder limit without success.  
 
With Filter Queries I can't seem to filter using the path - the document library has a folder for each year going back to 2017, but only need to compare two most recent years (2024 & 2025).  It seems that substringof() is the recommended method, but FileDirRef is just giving the filename, not the path/folders.  I can see the outputs have a {Path} and a {Link} field that both contain what I need and would work, but those column names don't appear to be valid.  
 
There's also the limit by Folder option, but the folders don't seem to populate from this document library in the pulldown, and manually entering either 2025 or a dozen variations I can think of gives a Bad Request error.  
 
Any ideas/suggestions?  The ultimate goal is to get a list of files from a source directory, compare to these files in the Document Library, and if they already exist in the document library, delete from the source directory.  I've got the rest of it all laid out and it appears to be working, just can't get the list of files from Document Library to compare the source list to.  
Categories:
I have the same question (0)
  • Verified answer
    tom_riha Profile Picture
    10,187 Most Valuable Professional on at
    Hello,
     
    try to use the FileRef in the filter query as explained e.g. here.
     
    substringof('2025', FileRef)
     
     
    ----------------------------------------------------------------------------------
    Did the answer solve your problem? Please click "Does this answer your question" and give it a like to help others in the community find the solution too!
     
    You can find more of my solution on the blog: https://tomriha.com!
  • DE-20031814-0 Profile Picture
    10 on at
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 813

#3
Haque Profile Picture

Haque 526

Last 30 days Overall leaderboard