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 con...
Power Automate
Unanswered

Comparing Dates in condition

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

I am trying to compare two dates .

 

Today and "Conclusion Date" but i get the error  

 

Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

 

I use Compose to get todays date  - formatDateTime(utcNow(),'yyyy-MM-dd')

 

wonka1234_0-1694442253397.png

 

but my conclusion date has dates of 10/2/2023.

 

is this a format TYPE for each field? or could this be the DATE format? 

 

 

Categories:
I have the same question (0)
  • wskinnermctc Profile Picture
    6,519 Moderator on at

    One of those two fields is empty or not returning a value.

    The function was invoked with values of type 'Null' and 'String' that do not match.

     

    See how it says one of the types was 'Null'? That means one of them doesn't have a value at all. So you are trying to compare a string/text to nothing, which isn't possible.

     

    You need to check the outputs of that Conclusion Date or the outputs of your compose expression and see which one is not producing a value.

  • RobElliott Profile Picture
    10,525 Super User 2026 Season 1 on at

    @wonka1234 date formats must be in the same format on both side of the condition, and both in yyyy-MM-dd format. So youu need to add a compose action and add a formatDateTime expression with the date format yyyy-MM-dd. Then use the outputs of that Compose in the condition.

     

    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.

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @wskinnermctc  why would it be null? in my sharepoint list this column always has values. 

    @RobElliott   I have changed the format of the today date to formatDateTime(utcNow(),'MM/dd/yyyy')  to match conclusion date.

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Show a screenshot of the compose you are using to compare with. Maybe you have the expression incorrectly put into the Compose.

     

    You will probably need to do more adjustments to make sure you are comparing datetime to datetime. 


    What is the column type of "Conclusion Date" in your sharepoint list? Is it a single line text string? Or is it a Date Time with the date only? Go look at your SharePoint list settings to see.

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @wskinnermctc 

     

    here is my compose - 

    wonka1234_0-1694444315653.png

     

    Comparison-

    wonka1234_1-1694444339001.png

     

     

    Conclusion DAte - DateTime Format in my list

    wonka1234_2-1694444367145.png

     

    compose value - 

    wonka1234_3-1694444481472.png

     

     

    I am assuming this the compare is where the error is occuring.

     

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    That is helpful, but can you show me what is in the SharePoint List settings that shows the column types?

     

    Here is an example of the screen. 

    SharePoint List SettingsSharePoint List Settings

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @wskinnermctc 

     

    does this help?

     

    wonka1234_0-1694444902580.png

     

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    Yes, don't worry about formatting the utcNow() expression or using a compose.

     

    Here is an example of a SharePoint List where I have a column "PurchaseDate" that is a Date Time type column which only has the date.

    Purchase DatePurchase Date

     

     

    If I wanted to compare which purchases were less than today it would look like this below:

    Date Condition CompareDate Condition Compare

     

    The utcNow() is by itself with no formatting.

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @wskinnermctc sadly, still getting the error  

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'Null' and 'String' that do not match.'.

     

    not sure where its going wrong here..

  • wskinnermctc Profile Picture
    6,519 Moderator on at

    If you are still getting the error then it most likely has to do with the value coming from SharePoint and/or how your flow is arranged.

     

    Since we know the utcNow() will always have a value, it must be the SharePoint field that is the problem.

     

    You will have to show more of your flow for me to determine the error. I'm guessing it has something to do with your Apply to Each and what is the source being used for the Dynamic Content of the Conclusion Date.

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 246 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 176

#3
Haque Profile Picture

Haque 157

Last 30 days Overall leaderboard