cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
annetoal
Super User
Super User

ODATA filter query question

I'm using Get files (properties only) to filter results from a SharePoint Library. I want to keep all files with a column date (reviewNotice) before now, and discard all the ones in the Archive folder. Here's my ODATA filter:

(reviewNotice le '@{body('Convert_time_zone')}') and ('{Path}' ne xxxxx/Archive/)

 Here's the error message:

The expression "(reviewNotice le '2021-12-21 09:22:52Z') and ('{Path}' ne xxxxx/Archive/)" is not valid. Creating query failed.

Please help!

Thanks,

Anne

2 ACCEPTED SOLUTIONS

Accepted Solutions
Taylor_Becktold
Resolver III
Resolver III

Hi @annetoal  -

 

From a glance, your queries look correct. Could you provide a screenshot of the action and query from Flow? That will make it easier for us to identify any potential issues.

 

Did my reply help? Please give it a thumbs up.
Did my reply answer your question? Please mark it as a solution!
If you liked my response, please consider giving it a thumbs up.

View solution in original post

v-bofeng-msft
Community Support
Community Support

Hi @annetoal :

I'm afraid fields like {Path} are invalid in Filter Query.

Using Filter array is a good choice, I have configured it based on what you provided.

I've made a test for your reference:

vbofengmsft_1-1640140965149.png

@and(
  not(equals(item()?['{Path}'], 'xxxxx/Archive/')),
  less(item()?['reviewNotice'],body('Convert_time_zone'))
)

 I think this link will help you a lot:

https://powerusers.microsoft.com/t5/Building-Flows/Microsoft-Flow-Get-files-properties-only-of-file-...

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Taylor_Becktold
Resolver III
Resolver III

Hi @annetoal  -

 

From a glance, your queries look correct. Could you provide a screenshot of the action and query from Flow? That will make it easier for us to identify any potential issues.

 

Did my reply help? Please give it a thumbs up.
Did my reply answer your question? Please mark it as a solution!
If you liked my response, please consider giving it a thumbs up.

v-bofeng-msft
Community Support
Community Support

Hi @annetoal :

I'm afraid fields like {Path} are invalid in Filter Query.

Using Filter array is a good choice, I have configured it based on what you provided.

I've made a test for your reference:

vbofengmsft_1-1640140965149.png

@and(
  not(equals(item()?['{Path}'], 'xxxxx/Archive/')),
  less(item()?['reviewNotice'],body('Convert_time_zone'))
)

 I think this link will help you a lot:

https://powerusers.microsoft.com/t5/Building-Flows/Microsoft-Flow-Get-files-properties-only-of-file-...

Best Regards,

Bof

Thanks so much. My filter read

@not(equals(item()?['{Path}'], '/Archive'))

I had already been experimenting with the Filter command, but I failed to put the site name before the slash. Also, I did not include the less(item() afterwards. It works great, thank you so much.

 

Anne

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,162)