Hide a form field based on multiple selections in a dropdown

  • 13 January 2018
  • 2 replies
  • 11 views

Badge +1

Hello all.

I have a rather large work request form I have created with rules that hide/unhide fields based on what the user has selected (at least 30 rules), so I already have a basic understanding of how to hide fields. However, I'm having trouble with the following scenario on a dropdown.

 

I have a free text field called "Cost Code", that I only want to display to the user when they select "Furniture Request / Repair", " Janitorial Services", "Nameplate Request", and "Office Moves / Reconfiguration" on a dropdown, but keep the field hidden if the user selects something else (at least 20 selections available in this dropdown). I have no problems displaying the cost code field when the user selects one option. For example: (RequestTypeDropdown!='Furniture Request / Repair') works just fine for one selection.

 

If I add a second option in the condition using an Or statement or adding a single rule for each of the four selections (for example, four rules with the following syntax: RequestTypeDropdown != "Option"), it doesn't display the cost code field at all. I have tried the following to no avail:

 

RequestTypeDropdown != "Janitorial Services" || RequestTypeDropdown != "Nameplate Request" || RequestTypeDropdown != "Nameplate Request" || RequestTypeDropdown != "Nameplate Request"

 212106_Nintex.PNG

I have also tried the following:

or(RequestTypeDropdown !="Janitorial Services", RequestTypeDropdown !="Nameplate Request")

 

Is there a simpler way to do this? Its likely I'm overthinking this and the solution is right in front of me. Working in SharePoint 2013.

 

Thanks for any help you can provide.


2 replies

Userlevel 5
Badge +14

Single expressions should be ANDed together, not ORed.

you write a rule to hide control. but your single expressions should prevent it from hiding.

so the control shouldn't hide if ANY of expressions evaluates to false

Badge +1

Marian - Thank you, this worked perfectly. I replaced the or statements with and statements and received the desired result.

RequestTypeDropdown != "Janitorial Services" && RequestTypeDropdown != "Office Moves / Reconfiguration" && RequestTypeDropdown != "Furniture Request / Repair" && RequestTypeDropdown != "Nameplate Request"

Thanks again!

Reply