cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lohaninarayan
Frequent Visitor

Dealing with null value.

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 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

4 REPLIES 4
DamoBird365
Super User
Super User

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.

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

 

 

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

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. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,716)