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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,516)