Skip to main content
Participant
June 9, 2021
Answered

Hide fields based on drop down selection with “or” statement

  • June 9, 2021
  • 1 reply
  • 1102 views

I am creating an asset inventory sheet for high voltage electrical equipment, on this sheet I have a drop down for the asset type. I also have fields for the specifications of the equipment. I am wanting to hide the spec fields that do not apply to the asset type when it is selected. My problem is there are certain specs that apply to multiple asset types so I would need some type of  "or" statement but I can not figure out how it should be shown in the formula. 
Here is what I have right now:

if(this.getField("Select Asset Classification").value=="Breaker"){event.target.display=display.visible}else{event.target.display=display.hidden}

I tried .value=="Breaker"||"Transformer" but that did not work. Does anyone have any suggestions? Thank you in advance.

This topic has been closed for replies.
Correct answer Bernd Alheit

this.getField("Select Asset Classification").value=="Breaker" ||

this.getField("Select Asset Classification").value=="Transformer"

 

or use a switch construct.

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
June 9, 2021

this.getField("Select Asset Classification").value=="Breaker" ||

this.getField("Select Asset Classification").value=="Transformer"

 

or use a switch construct.

Participant
June 9, 2021

Thank you!