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 Automate
Answered

Compare Dates

(0) ShareShare
ReportReport
Posted on by 79

Hi
I have created a flow wherein i need to compare 2 dates columns from 2 different excel sheets from SharePoint documents , but the flow is giving the following error ,  Unable to process template language expressions for action 'Condition' at line '1' and column '15509': 'In function 'formatDateTime', the value provided for date time string '35827' was not valid. The datetime string must match ISO 8601 format.'.  

Categories:
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hi @sabeoleonunes 

     

    As per my understanding, the dates returned by your Excel are not in ISO 8601 format (2020-08-14T13:56:59)

     

    Can you post the screenshot of the DateTime returned by Excel in your Power Automate(add a compose action and log the Excel DateTime value)? 

  • sabeoleonunes Profile Picture
    79 on at

    Hi @CFernandes  , My agenda is i need to create a flow wherein i need to compare 2 excel files which have column date in it , so i need to compare both and if the dates are not matching then send a mail to the user saying , the mail are not matching
    I am sharing my flow what i did , i have used the date expression as : 

    formatDateTime(items('Apply_to_each')?['date'], 'MM/dd')

    sabeoleonunes_1-1598528758310.png

    sabeoleonunes_3-1598528791618.png

    sabeoleonunes_4-1598528843884.png

    sabeoleonunes_6-1598528869986.png

    sabeoleonunes_8-1598528932611.png

    sabeoleonunes_10-1598528953190.png

     

    sabeoleonunes_11-1598529022769.png

    sabeoleonunes_13-1598529095473.png

     

     

    The error which i am getting is :  
    InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '15453': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'. 

     
     

     

     

     

     

     
     

     

     

  • sabeoleonunes Profile Picture
    79 on at

    Sending the flow again as it is not clear 

    sabeoleonunes_0-1598529639936.png

    sabeoleonunes_2-1598529666482.png

    sabeoleonunes_3-1598529703266.png

    sabeoleonunes_5-1598529731517.png

    sabeoleonunes_6-1598529753133.png

    sabeoleonunes_8-1598529787281.png

    sabeoleonunes_9-1598529812023.png

     

    sabeoleonunes_10-1598529847539.png

     

    sabeoleonunes_11-1598529864245.png

     

    sabeoleonunes_12-1598529897178.png

     

     

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    @sabeoleonunes Can you please share the screenshot of your excel file( I want to see how your date field appears).

     

    I also did a Quick google and found a thread with solution provided by @Pstork1 at  https://powerusers.microsoft.com/t5/General-Power-Automate/Compare-Dates/m-p/670569#M56353

     

  • sabeoleonunes Profile Picture
    79 on at

    Hi @CFernandes ,

    sabeoleonunes_0-1598531852327.png

    This is the first excel

    sabeoleonunes_1-1598531888980.png

    This is the second excel

     

  • Verified answer
    CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hi @sabeoleonunes 

     

    I am just doing this on the fly.

     

    CFernandes_0-1598542859121.png

     

    Formula Format Date -1 -

     

    formatDateTime(outputs('Date_1'),'yyyy-MM-dd')
     
    Fomula Format Date - 2- 
     
    formatDateTime(outputs('Date_2'),'yyyy-MM-dd')
     
    Condition  Formula -
     
    ticks(outputs('Format_Date_1'))  is greater than 
    ticks(outputs('Format_Date_2'))
     
    I am not 100% sure but I think ticks function turns the dates into a number representing the date. Give the above a try.
     
     

     

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 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard