cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MWAN
Helper I
Helper I

power automate get files (properties) only filter query not working

I tried to limit the get files (properties) only action to return only files under the current document set name. For example, I have a document set named DocumentRequest/MIKE 6-25 VERSIONING TEST_2020-6-25 14_21_12, which has 2 files.

 

the filter query should return just those two files.   I put FullPath eq FullPath from dynamic content as the filter query.

FullPath is the property in the json file returned from get files (properties) only action. 

 

2020-06-28_16-54-08.jpg

 

Keep getting error,  what is not right here?

2020-06-28_16-50-16.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions

Finally, I got it working, after many trials and errors. No good documentation about how it should work. 

 

1. In GetFiles(Properties only) the filter query should  be: ID equal 150
ID is literal, can't use ID from dynamic content; 150/number can't use single quote (but the text value need single quote!)

property with {} in response content can't be used.

 

2. Use RequestName (property in the response content) to match requestname column in Dynamic Content to filter down to the current document set and its files

 

2020-07-03_17-34-55.jpg

View solution in original post

10 REPLIES 10
abm
Super User
Super User

Hi @MWAN 

 

It could be the slash in your FullPath creating the issue.

 

Try encode the FullPath value by using an expression encodeUriComponent.
 
Thanks


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thanks for checking.

 

I have two fullpath in the filter query, which one you referred to?

How to encode the FullPath value by using an expression encodeUriComponent? Please give an example.

 

Appreciated!

abm
Super User
Super User

Hi @MWAN 

 

Add a compose and add the expression. Please see below.

 

First click the expression then type encodeUriComponent(). Next click Dynamic Content and select FullPath.

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

I used the encodeURIComponent() in Compose, still failed

 

2020-06-29_17-22-22 action.jpg2020-06-29_17-20-49-error.jpg

Hi @MWAN 

 

You need single quotes after the equal in your filter query.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Sorry, still failed... wrap single quote around fullpath after eq

 

The expression "DocumentRequest%2FGeorge%20testing%200629_2020-6-29%2010_29_45 eq 'DocumentRequest/George testing 0629_2020-6-29 10_29_45'" is not valid. Creating query failed.

 

DocumentRequest%2FGeorge%20testing%200629_2020-6-29%2010_29_45 won't match 'DocumentRequest/George testing 0629_2020-6-29 10_29_45'

abm
Super User
Super User

Hi @MWAN 

 

Thanks for the screen share. You won't be able to do the ODATA filter for the below file properties. Not sure what object type these are. You can do the filter by ID. 

 

image.png

 

If you would like to filter by path using the ODATA filter query then use a custom column to update the path using another flow and use this new custom column to filter your results. This may works for you.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

The response data has id property so I put ID(dynamic content) eq '150' but still got an error: The query is not valid.

 

My purpose is to get the ID item property of the file items under a document set using Filter Query in Get Files (properties) only action.

 

 

Hi @MWAN 

 

 

Could you try without the single quotes? If that doesn't work please post a screenshot of your flow?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Finally, I got it working, after many trials and errors. No good documentation about how it should work. 

 

1. In GetFiles(Properties only) the filter query should  be: ID equal 150
ID is literal, can't use ID from dynamic content; 150/number can't use single quote (but the text value need single quote!)

property with {} in response content can't be used.

 

2. Use RequestName (property in the response content) to match requestname column in Dynamic Content to filter down to the current document set and its files

 

2020-07-03_17-34-55.jpg

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,021)