cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
robgar
Helper II
Helper II

Using Empty Expression with a Condition

I have a need to use the Empty expression to set a condition branch.  The problem is that the field I am checking to see if empty always returns as false (suggesting there is a value).  I see no value in the field and have no idea how to set this condition so that it will take the proper path.

 

Here is my empty expression

empty(item()?['varBenefitsStartDate'])

 

varBenefitsStartDate value is a MS Form date field.  You can clearly see that the field has no value both in the variable I've set for it, as well as the Get Details from the form submission:

Screenshot 2020-09-14 203624.pngScreenshot 2020-09-14 203726.png

 

The reason I need a condition is that the date field will sometimes be blank (intentionally).  I need to be able to have one path that formats the value when there is a date, and another path to set a variable string value to a value of my choosing when it's blank.  Problem is the condition results never change (always thinks the field is populated).

 

Here is a snapshot of the condition and preceding variables set if it helps:

Screenshot 2020-09-14 204232.png

 

What the heck am I missing?

3 REPLIES 3
psycrkz1
Community Support
Community Support

You can try to use the condition with your dynamics value equal to null as below:

psycrkz1_0-1600141825029.png

To check if the input dynamic value is empty or not

 

Hope it would help

Value isn't null either .. apparently.  I tried that already.  I worked around this by completely changing my process and using a calculation to get what I needed.  The way I was doing it had to many obstacles.

Bansari_Pandya
Helper III
Helper III

@robgar Here one simple solution which is definitely work.

 

What you need to do is after initialize the variable, you set the value of that variable with empty function.

Bansari_Pandya_0-1600194738674.png

 and then compare the variable equal to true.

 

Bansari_Pandya_1-1600194819731.png

 

If it will work , accept as solution so that will help other people in future.

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,236)