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 / Filter Query is not wo...
Power Automate
Suggested Answer

Filter Query is not working correctly

(2) ShareShare
ReportReport
Posted on by 10
I am working on a workflow that work like this:
User puts in list of names > workflow will search excel file for names and values like desired pdf location > workflow then splits the pdf location value as its stored together > workflow then based off which folder desired pdf is in will run in that specific condition > workflow will then Get File (properties only) filtering for the specific pdf > Create sharing link for a file or folder to make a link to desired pdf > then pdf gets returned
 
My current issue right now that the output from Get files (properties only) returns as []. I have tried using filter query with a bunch of different expressions but it keeps being returned as []. The compose body that is being used is the value that is being split, for example it is stored as File1/000001.pdf so I split it so the values are separated and 000001.pdf is being used to filter query for. The Limit Entries to Folder is the correct file path and I can't move the desired pdfs somewhere else as there are concerns that it may mess up other processes. 
 
For clarification for the images below, Compose (Searching for PDF) holds the split value result and Compose (FOR ID) holds the same value without the .pdf at the end. I wanted to test that out to see if there would be any difference and there wasn't.
 
Can anyone offer any help? 
 
 
Below is the input and output from a recent run
 
Categories:
I have the same question (0)
  • Tomac Profile Picture
    4,031 Moderator on at
    Please verify the filter query looks correct in a completed flow run. Go into a completed run, expand that action, and take a screenshot of the action's inputs and outputs so we can see what information Power Automate is working with at runtime.
  • JC-09121413-0 Profile Picture
    10 on at
    I added the input and output
  • Suggested answer
    Tomac Profile Picture
    4,031 Moderator on at
    Looks like your query filter has an extra carriage return in the text box that's throwing things off. Remove the newline/carriage return and it should work fine.
  • ashlega Profile Picture
    103 on at
    Hey,
     
     
    the action should work (and does work for me in my environment), but I am wondering if, somehow, the flow is running under the account that does not have permissions to see those files in Sharepoint, since it's being called from the agent.
     
    Perhaps you could just do a quick test: create a new instant cloud flow, add GetFileProperties action, make sure you are using your account for the connection reference, hardcode the filter (as in, just type in FileLeafRef eq '0000001.pdf' , without doing all the parsing), then test the flow and see if you'll get correct output.
     
    Thanks,
    Alex Shlega
     
     
  • Suggested answer
    Tomac Profile Picture
    4,031 Moderator on at
    As I said above, the problem is a newline character being added because of a carriage return in the text box:
     
    This is causing a newline ( \n ) to be added to the filter query at runtime:
  • JC-09121413-0 Profile Picture
    10 on at
     I have gotten rid of the extra space and I have looked in the code view and there is no \n. I have attempted to try it in another workflow where I used the exact name which is "000001.pdf" which is how it looks like in the SharePoint site folder. I do have permission to edit and view and I am using my connections for the workflow.
     
     

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 255 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 169 Super User 2025 Season 2

#3
harshdeol Profile Picture

harshdeol 167 Moderator

Last 30 days Overall leaderboard