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

Condition checking value of choice field with empty value

I have a choice field with several string values and the first (default) value is empty.

I am trying to create a condition to check whether the selected value is empty or not.

What is the best way to accomplish this?

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft Solution Sage
Solution Sage

Re: Condition checking value of choice field with empty value

Hi @adove ,

 I have made a test on my side, please take a try with the following workaround:

You should set the condition like below:

The expression in Condition is:

empty(triggerBody()?['Engineer_x0028_s_x0029_']?['Value']) is equal to ture

Capture4.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Condition checking value of choice field with empty value

Hi there.

A common method is not(empty(‘<data>‘)) but other options out there.

Please give it a try.

Thanks, Alan.

Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


adove Helper II
Helper II

Re: Condition checking value of choice field with empty value

It is not working as expected. Here is what I have:

Engineer(s) is my SharePoint choice field

My expression looks like this: 

not(empty(triggerBody()?['Engineer_x0028_s_x0029_']?['Value']))
 
my condition look like this: Engineer(s)  'is equal to'  expression
 
It is forcing data through the false branch regardless if my Engineer is blank or has a value.
Super User
Super User

Re: Condition checking value of choice field with empty value


@adove wrote:

It is not working as expected. Here is what I have:

Engineer(s) is my SharePoint choice field

My expression looks like this: 

not(empty(triggerBody()?['Engineer_x0028_s_x0029_']?['Value']))
 
my condition look like this: Engineer(s)  'is equal to'  expression
 
It is forcing data through the false branch regardless if my Engineer is blank or has a value.

Your expression code should have an @ sign in front of it, I'm sure you do, and maybe the forum just screwed it up, but I wanted to point it out just in case, it should look like this:

@not(empty(triggerBody()?['Engineer_x0028_s_x0029_']?['Value']))

I have three nearly identical conditions as yours in one of my hybrid approval flows, which look like this: 

Condition 1
@not(equals(triggerBody()?['Submitter_x0029_']?['Email'], null))

Condition 2
@not(equals(triggerBody()?['Approver_x0029_']?['Email'], null))

Condition 3
@equals(body('Start_Submission_Approval')?['response'], 'Approve')

If you're notice, in my first two conditions, I've opted for is not equal to as the operator for the condition, and I've relied on that one much more. This approvla flow actually utilizes a "people picker" rather than a selection box for setting the various people-filled columns, and this logic works is the only logic we could use to get it to work with people picker. Here's what the first two look like in the designer: ApprovalNotNull.png

This A Visual Explanation of Flow Logical Expressions has helped me a great deal with improving the logic in my logical expressions.

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-zhos-msft Solution Sage
Solution Sage

Re: Condition checking value of choice field with empty value

Hi @adove ,

 I have made a test on my side, please take a try with the following workaround:

You should set the condition like below:

The expression in Condition is:

empty(triggerBody()?['Engineer_x0028_s_x0029_']?['Value']) is equal to ture

Capture4.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (6,829)