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 / File not being found w...
Power Automate
Answered

File not being found with 'Get files (properties only) + Filter Query on FileLeafRef

(0) ShareShare
ReportReport
Posted on by 41

I have a manually triggered (button) Power Automate flow set up in a SharePoint Document library.

 

When the flow is triggered, the user is prompted to attach a file in the run flow window (this new file will replace/override the selected file).

 

The first step of the flow is to do a check to make sure the new uploaded file does not already exist in the library.

I am using ‘Get files (properties only)’ with a Filter Query:

lorinda_abey_0-1710899873436.png

 

I am then using a ‘Condition’ step to confirm if a file was found of this name or not.

lorinda_abey_1-1710899873438.png

 

Expression being used as follows:

length(outputs('Get_files_(properties_only)_2')?['body/value'])

 

If a file of the same name and extension exists, an email notification is sent to the user who triggered the flow and the flow is terminated (cancelled).

 

This has been working fine (I have an example flow from 2 days ago that worked).

 

Today I have a scenario where a file of the same name and extension existed but it was not picked up by this condition / check and caused an issue further down in the approval flow.

 

I am trying to diagnose why the ‘Get files (properties only)’ did not return a value for the file that existed.

Below is a screenshot of the outputs and another showing that the file exists and can easily be found with a search.

lorinda_abey_2-1710899873443.png

 

lorinda_abey_3-1710899873445.png

 

Any ideas why the file was not picked up in this instance?

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @lorinda_abey ,

     

    This may be caused by the number of document library files.

    Could you tell me how many files are in the document library?

    If the count is less than 5000, please try this

    vxiaochenmsft_0-1710900956203.png

     

    Best Regards,

    Wearsky

  • lorinda_abey Profile Picture
    41 on at

    We have over 9000 files in this document library.

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @lorinda_abey ,

     

    Please turn on the pagination setting and try again.

    vxiaochenmsft_0-1710912873422.png

     

     

    Best Regards,

    Wearsky

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard