cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.


@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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (7,779)