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

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Condition returns False when comparing Dates from Excel

(0) ShareShare
ReportReport
Posted on by

This is a bit of an odd one as I've solved the problem but I don't understand A) why its a problem or B)  if I did the right thing...

 

Daily pull dates from Excel table and if they are 30 days from now send an email if not do nothing.

Entire Flow:

JamesRobsonBio_3-1712135564858.png

 

Compose:

formatDateTime(addDays('1899-12-30', int(item()?['Calibration Expiry Date']), 'yyyy-MM-dd'),'yyyy-MM-dd')

JamesRobsonBio_4-1712135593676.png

 

Condition:

outputs('Compose') is equal to formatDateTime(addDays(utcNow(), 30), 'yyyy-MM-dd')
JamesRobsonBio_2-1712135507829.png

 

 

Now what I don't understand is this would always return false even though the dates looked the same (I added an extra compose to check my Condition date) until I added the formatDateTime to both the Compose and Condition??

 

Am I doing something wrong or is this just now PA interacts with Excel dates? (although in my mind that makes no sense for the Condition to also need the formatDateTime)

 

 

Thanks,

I have the same question (0)
  • Verified answer
    v-yetonggu-msft Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    Hi @JamesRobsonBio ,

    Please select ISO 8601 format in List rows present into table.

    vyetonggumsft_0-1712136554335.png

    Use this expression on the right side of condition:

    formatDateTime(item()?['Calibration Expiry Date'],'yyyy-MM-dd')

    Use this expression on the left side of condition

    addDays(utcNow(),30,'yyyy-MM-dd')

    Best Regards,

    Sunshine Gu

  • JR-20121253-0 Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    Hi,

     

    Made those changes and getting the following:

    JamesRobsonBio_0-1712139327620.png

     

    just to confirm changes made:

    JamesRobsonBio_1-1712139415689.png

    JamesRobsonBio_2-1712139501421.png

     

    Thanks,

  • v-yetonggu-msft Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    Hi @JamesRobsonBio ,

    vyetonggumsft_0-1712139698473.png

    This error means that you did not select the ISO 8601 format in List rows present into table.

    Please make sure you select the ISO 8601 format.

     

    Best Regards,

    Sunshine Gu

  • JR-20121253-0 Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    I selected this in the Parameters section of the List Rows do I need to do it elsewhere?

    JamesRobsonBio_1-1712140301501.png

    Or is my compose section now incorrect now I've changed that (although I don't see us referencing it any more?)

    formatDateTime(addDays('1899-12-30', int(item()?['Calibration Expiry Date']), 'yyyy-MM-dd'),'yyyy-MM-dd')
     
    Thanks,
  • v-yetonggu-msft Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    Hi @JamesRobsonBio ï¼Œ

    Please re-create the flow and switch to classic designer.

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_3-1712141977361.png

    vyetonggumsft_5-1712142139743.png

    formatDateTime(items('Apply_to_each')?['Due'],'yyyy-MM-dd')
    addDays(utcNow(),30,'yyyy-MM-dd')

    Best Regards,

    Sunshine Gu

  • JR-20121253-0 Profile Picture
    on at
    Re: Condition returns False when comparing Dates from Excel

    Thanks for the breakdown, for some reason I'm still getting the same error:

    JamesRobsonBio_0-1712154507427.png

     

    and the only way I can get around it is by changing my compose step to

    addDays('1899-12-30', int(item()?['Calibration Expiry Date']), 'yyyy-MM-dd')

    I wonder if its my source data that's causing the issue?? I'll create a new test file and try the above solution, if it works I'll make the thread as resolved.

     

    Thanks,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard

Featured topics

Restore a deleted flow