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 through Shar...
Power Automate
Answered

Get Files through Sharepoint not returning files reliably

(0) ShareShare
ReportReport
Posted on by 104

Strange issue with my SharePoint "Get files (prop only)" sometimes finding the files and sometimes not.

I have a SharePoint library with files that have the date as part of the file name. Usually there will be one or 2 files with each date, sometimes none.
I am using a filter in my "get files" to return a list of files found that meet my filter (the date).

But when I run the flow with a date for a file I know is there, it sometimes finds it and sometimes doesn't.

 

 

David2831_0-1648139282910.png

 

David2831_1-1648139577499.png

 

My filter = FSObjType eq 0 and substringof('@{variables('varStartDate')}',FileLeafRef)

The value of varStartDate is a string and will be something like = '2022-03-20'

 

Again, sometimes it works and sometimes not.  There are less than or about 100 files in these folders right now, but over time it will grow to around 500.  No sub folders for now either, but when there are some in the future, I would want to exclude them from the search. 

(I plan to move files over a year old into a subfolder by year. I will not be searching those.)

So I will change "include nested items" to no.

 

My flow cycles through about 20 folders checking each one individually, and adding a link to each located file to an array variable.

 

Any thoughts on why this isn't working correctly?

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @David2831 ,

     

    Try and add brackets to the first query condition:

    (FSObjType eq 0) and substringof('@{variables('varStartDate')}',FileLeafRef)

     

    or you could try startswith instead:

    (FSObjType eq 0) and startswith(FileLeafRef,'@{variables('varStartDate')}')

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • David2831 Profile Picture
    104 on at

    That doesnt seem to have helped, but the problem is kind of intermittent.

     

    Please answer me this, the SharePoint library I am pulling from just increased over 5000 items.  It's well sorted by folders, but I am getting mixed info on if folders matter when dealing with a large library of files.

     

    If I run a "Get files prop only" on a folder with a few hundred files, but the library has over 5 or 6000 files, could that cause unreliable search results?  And how do I resolve this?  I have tried to create filtered views using some metadata columns I added, but the filters are ignored, only the columns are used and since all 5000+ files have the same columns this doesn't seem to help.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @David2831 ï¼Œ

     

    You will find the answers from below thread:

    https://powerusers.microsoft.com/t5/Building-Flows/5000-files-filter-query-using-Get-Files-Properties-Only/td-p/904865

     

    Please refer to below blogs for more details:

    https://alextofan.com/2019/08/22/how-to-get-more-than-5000-item-from-sharepoint-online-in-flow/

    https://www.tachytelic.net/2020/04/get-more-5000-items-sharepoint-power-automate/

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • David2831 Profile Picture
    104 on at

    Thank you for the links, those were very informative.

     

    Most of those deal with trying to get back over 5000 items or library files.  In my case I am only looking to get back a few hundred at most, and usually just 3 or 4.  My concern is learning how to properly search on SharePoint for the info I need and only return a few files / file properties, instead of the whole library.

     

    Can you or anyone tell me if the "Limit entries to folder" and "Filter Query" options in a get files action are processed on the SharePoint library or by the flow itself?  Or to ask another way, if my library has 50,000 files and I craft a "Get Files" action with folders and filters that I know will only give me 5 results from my data, will SharePoint return just my 5 files/properties, or will it try to send back 50,000 (hitting the limits) for the flow to sort through?

  • David2831 Profile Picture
    104 on at

    Still hoping for a reply to that last question.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @David2831 ,

     

    Based on below blog:

    https://powerautomate.microsoft.com/en-us/blog/advanced-flow-of-the-week-filtering-with-odata/

    Since Microsoft Flow's connectors are built-upon RESTful APIs, many of our connectors support the ability to filter datasets server-side using OData.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard