cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tonylitvak
New Member

Get Files Filter Query

Hello friends.  Hope someone can help.  I am trying to filter the contents of a library to records who's RemindDate field is equal to the UTC.  Here's my syntax in the Filter Query property of the Get Files 

RemindDate eq formatDateTime(utcNow(),'MM-dd-yyyy').  The RemindDate field is a calculated column and is stored as DATE ONLY format.  

 

I'm getting this message with a status of 400
 

  "message""The field 'RemindDate' of type 'Calculated' cannot be used in the query filter expression.\r\nclientRequestId: 8459d7bf-7d33-40c2-a1a5-d6aa4b5c298b\r\nserviceRequestId: 8459d7bf-7d33-40c2-a1a5-d6aa4b5c298b"
 
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @tonylitvak ,

 

If we couldn't filter the items in the Get items action, then maybe the only way is to change the column type from lookup.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
DeepakS
Resident Rockstar
Resident Rockstar

Hi @tonylitvak 

 

to get the correct date you should type formatedatetime function in expression instead in filter query box , something like this:

Date11.png

 

---------------------------------------------------------------------------------------

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

Hey @DeepakS thank you for the quick response.  I tried your suggestion and have a slightly different error message.  I also tried the  formatDateTime(utcNow(),'MM-dd-yyyy') thinking it will match the date format of the column called RemindDate2 but this didnt work as well.

 

  "message""The field 'RemindDate2' of type 'Calculated' cannot be used in the query filter expression.\r\nclientRequestId: 0d6f286d-d160-472a-b0d9-0367671e2802\r\nserviceRequestId: 0d6f286d-d160-472a-b0d9-0367671e2802"

filter.PNG

v-alzhan-msft
Community Support
Community Support

Hi @tonylitvak ,

 

The error message told that the field 'RemindDate 2' of type 'Calculated' cannot be used in the query filter expression, so you couldn't use the filter query for the Calculated column, please take a try to add a Filter Array action under the Get files action as my screenshot below:

1.png

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-alzhan-msft thank you.  So the flow is working, but it does not appear to be respecting the filter.  I have 3 documents in a library for testing purposes, none of which have a remind date set to utc.  However, when the flow runs, i get 3 email messages, prompting me to think that the filter may not be constructed correctly?  My goal is to only process email messages where the remind date is set to utc date.

 

Heres my screenshot and again, big thank you for helping.library.PNG

 

filter2.PNG

Hello,

Instead of the filter array action, can you try and use a IF Condition and construct it the same way you did with filter array.

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Hi @tonylitvak ,

 

You should choose the Body dynamic content from the Filter Array action, and you couldn't use the dynamic content from the Get files action inside the Send an email action, you could only add expression as my screenshot below:

1.png

items('Apply_to_each')?['RemindDate2']

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @Jcook .  My understanding is that theres a limit on max number of items or documents that flow will retrieve currently set to 5000.  my library has well over 50,000 documents.  While im sure the if condition logic will work, the flow will fail since it wont be able to process each document because of the threshold limit.

Hi @tonylitvak ,

 

If we couldn't filter the items in the Get items action, then maybe the only way is to change the column type from lookup.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,193)