Skip to main content
Community site session details

Community site session details

Session Id : qG4HvwQOWDeFyonN5Y4iD3
Power Automate - Building Flows
Unanswered

Flow is unable to compare dates using NULL and OR

Like (0) ShareShare
ReportReport
Posted on 3 Mar 2020 15:35:19 by 85

Hello,

 

I have a super simple flow that doesnt seem to work.  Basically I am comparing two date fields, but 1 of the dates may be null.

 

I am using an OR condition to check if event Date is greater than the last event date OR the Last Event Date is Null.

 

The flow fails every time  when the Last Event Date is Null.  But I have setup the logic correctly and it would seem that this should work. But it fails every time the last event date is null. Why doesn't flow work as expected here?

 

01.png

 

 

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

  • Laura3 Profile Picture
    71 on 09 Apr 2022 at 13:12:56
    Re: Flow is unable to compare dates using NULL and OR

    Sorry, but this didn't work for me and my flow is almost identical. It seems to have an issue with the True part of the statement. Could you spell out the actual syntax you used for True? Sorry, I'm a novice at this. 

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 03 Mar 2020 at 21:38:43
    Re: Flow is unable to compare dates using NULL and OR

    Hi @Larry_Casey 

     

    I have created a list and added two date columns similar like yours. Assuming Event Date cannot be null then you can follow the below steps. If not change the logic similar like the empty check I am doing. 

     

    image.png

     

    Above empty expression is as follows:

    empty(items('Apply_to_each')?['Last_Event'])
     
    You need to check the empty check first, if not check the event date > last event otherwise you get the null exception error you were getting earlier.
     
    Here are my test results:
     
    This is my List
    image.png
     
    Here are my flow results:
     
    image.png
     
    Second record index
     
    image.pngimage.png
     
  • Pstork1 Profile Picture
    67,077 Most Valuable Professional on 03 Mar 2020 at 20:34:51
    Re: Flow is unable to compare dates using NULL and OR

    The problem is that if you don't set a default date on a date in SharePoint then Flow doesn't return that field in the results unless its filled in.  So you can't test if the date value is Null because the field itself isn't included in the JSON results when you do a Get Item or Get Items.  If you look at the JSON in your runs you'll see that the field itself is missing from some of the records.  I think the only way to make this work is to default the date in SharePoint to some date in the distant past and then check against that date when you would check to see if its null.  But at least if there was a date there then the field would be returned.

  • lcasey233 Profile Picture
    85 on 03 Mar 2020 at 16:56:42
    Re: Flow is unable to compare dates using NULL and OR

    @abm   I now understand what you were telling me.  I did not realize I needed to use the field value in the empty string

     

    Empty(item()?['Last_Event']) is equal to  True
     
    I am not a programmer so it took me a minute to figure out the correct syntax for empty
     
    Thanks again!
     
  • lcasey233 Profile Picture
    85 on 03 Mar 2020 at 16:53:46
    Re: Flow is unable to compare dates using NULL and OR

    All,

     

    I have found the solution and really appreciate all your assistance and help. Everyone here contributed to finding the answer. I am not a programmer so this is all really new to me and now it makes sense. There is no Power Automate outage 😉

     

    I had to use the following which was mentioned, but I didn't realize I needed to add the field value to empty.

     

    Empty(item()?['Last_Event']) is equal to  True
     
    So the  condition looks like this:
     

     

    01.png

  • ChristianAbata Profile Picture
    8,949 Most Valuable Professional on 03 Mar 2020 at 16:36:25
    Re: Flow is unable to compare dates using NULL and OR

    @Larry_Casey  could please you copy an paste what is inside of get items?

  • lcasey233 Profile Picture
    85 on 03 Mar 2020 at 16:29:01
    Re: Flow is unable to compare dates using NULL and OR

    No matter what I try, Even if I remove the OR, Flow can not determine if a date field is empty.

     

    This must be an Outage.  I encourage anyone in this forum to try and you will see.

     

    • Simply create two date Fields in a SharePoint List.
    • Name them: Event_Date and Last_Event_Date   (They are date fields)
    • Leave the Last_Event_Date empty
    • Then try to determine if the Last_Event_Date is empty.

      Last_event_Date is empty, null, blank, string(null) etc...... I have ran through every single possible combination and flow will never recognize that a date field is empty. It returns false every single time.

     

     

  • lcasey233 Profile Picture
    85 on 03 Mar 2020 at 16:16:19
    Re: Flow is unable to compare dates using NULL and OR

    01.png

  • lcasey233 Profile Picture
    85 on 03 Mar 2020 at 16:13:50
    Re: Flow is unable to compare dates using NULL and OR

    How can I check for empty like that in the OR condition?

     

    Basically I just need to know whether the Last_Event_date is empty OR the Event_Date is Greater than or equal to the Last_Event_Date.

     

    Then apply an action if True.

     

     

    01.png

  • abm abm Profile Picture
    32,506 Most Valuable Professional on 03 Mar 2020 at 16:06:54
    Re: Flow is unable to compare dates using NULL and OR

    Hi @Larry_Casey 

     

    You need to check empty check like this.

     

    image.png

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1

Loading complete