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
Frequent Visitor

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (880)