cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KoenSmeulders
Frequent Visitor

Filter query date eq doesn't return values

I'm a bit stuck here, I'm trying to get a specific item from a list based on the Location (lookup) and Date fields, this combination is unique and will only return a single item so I can get it's ID to update it.

 

In the 'Get items' action I'm using a filter query but for some reason using 'eq' for the date doesn't work for me while testing with 'gt' returns the item I'm looking for plus all later dates, while 'lt' returns every item before (not including) the date.

 

Looking at the return body of the queries that return items, shows me the date format is correct. For instance, I can get items with "Date": "2020-06-11", while a query with Date eq '2020-06-11' will not return any results.

 

Can anyone help me with this? My backup plan is just using 'gt' and taking the first item (since it's the date I'm looking for) but this feels wrong.

9 REPLIES 9
Mira_Ghaly
Dual Super User II
Dual Super User II

@KoenSmeulders 

Can you check your column type in sharepoint whether it is date time or date only; Make sure it is date only

 

If this post helps you with your problem, please mark your as Accepted solution.

If you like my response, please give it a Thumbs Up.

MG (Naturally Curious)

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

It is date only. It's also clear in the output body since date & time would return more than just the date.

@KoenSmeulders 

Can you paste a screenshot of your flow ?

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Here's the bit I'm having trouble with, It's the query in the "Get items" that's troubling me. The 'lt' you see now should be 'eq' but that doesn't return any values.

KoenSmeulders_2-1596540833384.png

 

The return of 'lt' starts off like this (note the date is in the correct format): 

KoenSmeulders_1-1596540721452.png

 

 

Hi @KoenSmeulders ,

 

The type of Location field does not seem to be the expected type. If the type of Location is calculated column or Choice, it cannot be configured as filters in Filter Query.

 

You can consider using Filter array or Condition to filter items. If the field type is Choice, then the Dynamic content you need to select should be Location Value.

 

Hope that makes sense.

 

Best Regards,

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

I have no issues using the Location field as a filter, it is a lookup column and I'm using the ID to filter.

The problems I'm having are related to the Date field.

@KoenSmeulders 

to compare to utcnow

use the below expression formatdatetime(utcnow(),'yyyy-MM-dd') instead of utcnow()

 

If this post helps you with your problem, please mark your as Accepted solution.

If you like my response, please give it a Thumbs Up.

MG (Naturally Curious)

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

It's not utcnow() that's giving me issues, it's when I'm trying to use eq for a specific date (to match a registration date and location in another list).

 

Now the reason I'm looking up previous registrations is because my flow appears to ignore those of a specific user, but only using the query: Datum eq '@{addDays(utcNow('yyyy-MM-dd'), -1, 'yyyy-MM-dd')}' and Location eq 'ID'. Maybe that's why my new query is giving me trouble too, since it's more or less the same thing. I can find those registrations when I only filter on location or date, but when I try to combine both, it seems to ignore a single user for some reason.

Red_Snow94
Advocate I
Advocate I

Did you ever find a solution to this? I am having a similar issue filtering dates

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,856)