cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How to hide a field based on a dropdown

Hi!

I have a dropdown in my form that pulls from another list, and if you choose any item other than "Headset" from the dropdown, I want another field to be hidden. So if you do choose "Headset", the other field should appear.

Sounds easy, right? I can't get it to work. I'm using Nintex for O365 and have no other forms in place on my form, so it's not an issue of conflicting rules.

I've tried using not(inArray(Item, "Headset")), as well as Item!="Headset"

Both rules hide the field all the time, never showing it when "Headset" is selected as the option.

I can't figure out what I'm doing wrong, though I'm sure it's something simple I'm overlooking. Any help would be appreciated!!

Thank you!

Labels: (1)
0 Kudos
Reply
4 Replies
Community Manager Community Manager
Community Manager

Re: How to hide a field based on a dropdown

Caite,

Great question and yes it should be working. Here is the formula you want to use and the steps to get this functional in your form.

not(contains(YourNamedControl, "Headset"))‍‍

  1. Pull in the ListLookup control and name it something meaningful
    1. In my case it was Test Lookup was used. This is required so you can reference it in the rule
    2. Make sure the rest of the control is configured to show the correct values (i.e.; Headset)
  2. For the control you want to show/hide, the rule needs to be running on that control
    1. Select the control (in my case it was Email)
    2. Rule Type - Formatting
    3. Condition - select the (fx) to build your function.
      1. Use the runtime function so that your rule evaluates a runtime value. Remember the rule must evaluate to true for it to fire or in this case "HIDE"
      2. I chose the runtime function "contains" because I wanted to check if the list lookup contains the value "headset" then Hide this control
      3. The formula for this was contains(My list lookup field, "value to check for") or contains(Test Lookup, "Headset") as you can see in the screenshot below.
      4. After testing for this and ensuring it worked, I reversed this by adding the not() condition. So when Test Lookup does not contain "headset" then hide the control, Email.

I hit preview and it worked... Hope that helps 

Accept as Solution Reply
Workflow Hero

Re: How to hide a field based on a dropdown

Thank you, this work brilliantly for my radio button lookup as well. 

Accept as Solution Reply
Workflow Hero

Re: How to hide a field based on a dropdown

I simply used a form variable for that:

1.

2.

In my case the element is hidden when "Puma" is selected.

Cheers

mai-kel

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to hide a field based on a dropdown

It may help if you put the lookup control name inside a parseLookup() function which will strip out the lookup control's #mark and ID No from the lookup list. Then your comparisons functions should start to work:

e.g.

not(contains(parseLookup(LookupControlName), 'Headset'))

or

not(equals(parseLookup(LookupControlName), 'Headset'))

0 Kudos
Accept as Solution Reply