Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Dealing with null value.

(0) ShareShare
ReportReport
Posted on by

Hi Beautiful people,

I am building a flow with a SharePoint  list.

I have two field 1. teamLeaderDate and 2. managerDate both containing date in string type. 

The idea here is, if one contain data other does not but we never know which contains data and which does not contains.

In my flow I have to check which field contains data and apply a conditional check on the data to send an email notification.

I have used following condition to check if the item is empty

lohaninarayan_2-1652937996649.png

 

If the condition meet

lohaninarayan_1-1652937904712.png

The idea I am using is if the managerDate is empty use the teamLeaderDate but after applying the first condition it is giving me an error of providing null value on second condition even though the data I have supplied on second condition have date value in it.

When I change first condition to something else the second condition does not throw an error but when I have this condition it throw an error of having null value.

Any help or suggestion will be appreciated.

Thanks

Narayan 

 

  • lohaninarayan Profile Picture
    on at
    Re: Dealing with null value.

    Hi @DamoBird365 

    Thanks for the reply. I was able to fix my issue with the if() statement but I also checked with your suggestion and it worked. I think coalesce() is better than if() in my situation.

    Thanks again. 

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Dealing with null value.

    Hi @lohaninarayan 

     

    You need to provide valid expressions and all strings for all of the list options and you appear to be missing item()? on the 2nd expression.

     

    coalesce(item()?['Investigation_TLCompleteDate'], item()?['Investigation_ManagerCloseOffDate'])

     

    Damien

  • lohaninarayan Profile Picture
    on at
    Re: Dealing with null value.

    Hi DamoBird365

    Thanks for the suggestion. I am trying to use coalesce() on your suggestion. I am using like this

    lohaninarayan_0-1652999496158.png

    The code I have used is 

    coalesce(item()?['Investigation_TLCompleteDate'], ['Investigation_ManagerCloseOffDate'])
    But when I click on ok button it is giving me following error.
    lohaninarayan_1-1652999566736.png

    Please let me know if I am doing it incorrectly.

    Thank you again.

    Narayan

     

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at
    Re: Dealing with null value.

    Hi @lohaninarayan 

     

    You could remove the first condition and just use the expression coalesce(). It takes a list of values and returns the first non null. So, in order of preference, insert your two dates and if the first is null the 2nd will be returned. You could also have a third date if needed should both be null, like a default of utcnow().

     

    the coalesce would be inserted inside you adddays expression.

     


    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts. 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

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