web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / gt and lt in utnow wor...
Power Automate
Answered

gt and lt in utnow work, but not eq...probably a formatdate issue?

(0) ShareShare
ReportReport
Posted on by 42

Hi- I am brand new to flow/automate and have had great success building flows with gt and lt TODAY.

I cannot get eq TODAY to work however. I assume it's because of a date formatting issue because it is probably returning minutes in addition to day and therefore there is no EXACT match?

 

If so, how do I write the query to also format the returned date to only include day?

 

Here is my current query:

Created eq 'addDays(utcNow(),-9)'

 

Thanks!

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @ahowes 

    The addDays() expression allows you to supply a date format - add a comma after the -9 and add your date format inside of single quotes.

    Here is a link to the date format documentation

    Please note that, if your data is stored in SharePoint, that a full date time minute second string is stored - trying to match that won't work for you.

    What are you trying to do?

     

  • ahowes Profile Picture
    42 on at

    Thanks, Scott.

    That did not return the expected result 😞

    I have multiple records created 10 days ago, but the query Created eq 'addDays(utcNow(),-10,'d')' returned no results (the gt and lt work, just not the eq). 

     
    Yes, the records are in a SharePoint list and I'm using the default Created column. I assume I need to strip the hours/minutes from the date returned...
     
    Thanks again!
  • Verified answer
    RobElliott Profile Picture
    10,420 Super User 2026 Season 1 on at

    @ahowes OK let's look at this another way. First of all add the Get items action but don't add a filter query. Then add a Convert time zone action with the base time as the Created column from your library and the format string as yyyy-MM-dd which Power Automate likes for comparisons.
    Next add a Compose and add the expression formatDateTime(addDays(utcNow(),-13),'yyyy-MM-dd') 

    (mine was look at documents creating 13 days ago just for this test).

    Finally, add a condition that looks at if the converted time zone is equal to the output of the Compose  x Days Ago then do whatever actions you need to do.

    0getItems-Convert-Compose.png

     

    1-Condition.png

    As you can see from the flow result below, the outputs of the convert time zone and compose are the same:

    2-outputs.png

    So hopefully that will give you another method to get your flow working.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

  • ahowes Profile Picture
    42 on at

    Rob-

    Thanks, worked like a charm! But...sure seems like a lot of steps to do something that ought to be so much easier. I'm brand new to Power Automate, so I have a lot to learn. I'll go back and study your reply and all those steps in the app so I can fully understand them.

    Have a great week!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 304

#2
David_MA Profile Picture

David_MA 245 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 243 Most Valuable Professional

Last 30 days Overall leaderboard