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

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
AlanPs1
Resident Rockstar
Resident Rockstar

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!


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.
Brad_Groux
Community Champion
Community Champion


@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!

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,324)