cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JBennett12
Helper III
Helper III

Using filter query to compare dates

Hi, I'm having an issue where my flow is always true in my flow, hence adding an item to my SP list. The issue I believe is my filter query. My date field which you can see below is in the form of, 'M-d-yyyy', and I'm comparing it to utcNow('M-d-yyyy'). Which I believe is using minutes and seconds as well (which would always be greater than my most recent SP item submission). Does anyone know how I could fix this? I only want the filter query to be true if the work area == 'Front Office' AND the Date (in 'M-d-yyyy' format) is less than today's date (in 'M-d-yyyy' format). Below is how my flow looks like now, and a pic of my SP Date column format.

Thank you,

JBennett12_0-1660657976314.png

 

JBennett12_1-1660657376838.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
David-
Solution Sage
Solution Sage

Filter queries use the ISO 8610 date format and not the date format selected at the site or user profile level. The ISO format is yyyy-MM-dd. Update your expression for the utcNow() date to the following and it should work:

 

 

formatDateTime(utcNow(),'yyyy-MM-dd')

 

 

 

View solution in original post

2 REPLIES 2
David-
Solution Sage
Solution Sage

Filter queries use the ISO 8610 date format and not the date format selected at the site or user profile level. The ISO format is yyyy-MM-dd. Update your expression for the utcNow() date to the following and it should work:

 

 

formatDateTime(utcNow(),'yyyy-MM-dd')

 

 

 

@David- 

Thank you, that worked.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

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.

Users online (4,590)