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 / Comparing Dates in Flow
Power Automate
Unanswered

Comparing Dates in Flow

(0) ShareShare
ReportReport
Posted on by 63

I have a flow in which I want an email to be sent is the date in the column attached (Capture.PNG) matches todays date, but I keep receiving the error message in my flow (Capture1.PNG).

 

Any help would be appreciated.Capture.PNG

 

Capture1.PNG

 

Categories:
  • efialttes Profile Picture
    14,756 on at

    Hi!

    Two comments:

    1,. Can you share the WDL expression you have currently assigned on the right side of your condition? I mean the formatDateTime() based expression

    2.-Is your Excel column formatted as Date? If so, I believe you should change the approach. Good stuff here

    https://powerusers.microsoft.com/t5/Connecting-To-Data/Date-format-in-data-table-from-Excel-source-using-Flow/m-p/700438#M10150

    A good troubleshooting approach is to add a dummy 'Compose' action block inside your 'Apply to each' just before your 'Condition' and assign as its input the Excel column value you evaluate later. THis way you can doublecheck its value easily

    Thanx!

     

     

  • GavinFins Profile Picture
    63 on at

    Formatted as a date as show below...

     

     

    Capture.PNGCapture1.PNG

  • efialttes Profile Picture
    14,756 on at

    Thanx for the feedback!

    The way Excel stores internally values added to cells of 'Date' format is by calculating the the nr of days between 30-12-1899 and the date represented in the cell . Please also note the JSON brings this number to your Flow as a string

    In order to transform it into a more readable format, two approaches:

    -either convert Excel column format to type text and manipulate the date format by means of formatDateTime() WDL function, or

    -apply the proper WDL expression. Assuming your Flow read rows by means of 'List rows present in a table' and iterate through its rows by means of an Apply To Each, I would try to add the following WDL expression on the left side of your Condition rule:

     

    formatDateTime(addDays('1899–12–30T00:00:00Z',int(item()?['YourDateColumnName'])),'yyyy-MM-dd')

     

     

    More info on this challenge here (English) or here (Spanish)

    Hope this helps

  • GavinFins Profile Picture
    63 on at

    Capture.PNG

     

    formatDateTime(addDays('1899–12–30T00:00:00Z',int(item()?['Week 1 review '])),'yyyy-MM-dd') 
     
    ^^ this is what I put in the expression on the left.
     

     

     

  • efialttes Profile Picture
    14,756 on at

    Hi!

    What is the expression currently assigned to the right? I would use this one:

    utcNow('yyyy-MM-dd')

     

    Hope this helps

  • GavinFins Profile Picture
    63 on at

    It did as it didn't match the expression on the left. However I now have the following error:-

     

    Capture.PNG

  • efialttes Profile Picture
    14,756 on at

    Thanx for reporting this!

    Bad news since '1899-12-30T00:00:00Z' used to be a valid format... but seems it is not valid anymore...so Microsoft engineers must have changed addDays() internal implementation

    Now good news! I've just verified '1899/12/30T00:00:00Z' works fine

    formatDateTime(addDays('1899/12/30T00:00:00Z',int(item()?['YourDateColumnName'])),'yyyy-MM-dd')

    Hope this helps

     

  • GavinFins Profile Picture
    63 on at

    Capture.PNG

  • efialttes Profile Picture
    14,756 on at

    Hi!

    So the Condition evaluation NOW works! At the beginnig of this thread, Power Automate throwed an error when trying to evaluate the condition rule on your Condition acton block. Now, after some design changes, you can see Power automate starts executing first action block on the true branch, but throws an error.

    We are closer to a happy ending!

    Now, what's the expression currently assigned inside the next action block, the one on the true branch that throws the new error?

     

    In the meanwhile, please remember that the easiest fastest way to say thanks to somebody that simply tried to help, even on weekends is by clicking on 'Thumbs up' in every answer from this current thread you found valuable... or even in all of them 😉

     
     

    Flow_thumbsUp.png

    THanx!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard