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

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,386)