# How to make vision text boxes / drop down selectors be hidden unless a previous step has a value input

**URL:** <https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 16, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980 "2022-07-16T12:52:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![batman01793](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@batman01793](https://forum.inductiveautomation.com/u/batman01793)\
**Post date:** [July 16, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/1 "2022-07-16T12:52:47Z")

</div>

I have a form that I am getting users to input data into - There are some options that would not need to be shown on the screen unless a value or selction is made on another data box on the same form.

I want to know how to I make a drop down or a text box toggle between visible and invisible based on the no selection label being something other than std - triggering a new part of the form to become visible.

I am using Vision

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 16, 2022, 12:56pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/2 "2022-07-16T12:56:52Z")

</div>

I recommend binding to the dropdown’s `selectedIndex` property. It will be -1 when nothing is selected. (An expression binding on the `visible` property of the target field.)

---

<div class="post-metadata">

**Author:** ![batman01793](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@batman01793](https://forum.inductiveautomation.com/u/batman01793)\
**Post date:** [July 16, 2022, 1:54pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/3 "2022-07-16T13:54:20Z")

</div>

That worked perfect - However…(theres always a however!) I have now bound the Visible property value to the drop down selected index & this is -1 when there is nothing selected … but this makes the object invisible when there is a selection and visible when the value is -1 ( is there a way I can reverse the behaviour of the visible property?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 16, 2022, 1:59pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/4 "2022-07-16T13:59:05Z")

</div>

Use an _ **expression** _ binding, not a simple property binding. In the expression, use the `!=` comparison.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 16, 2022, 2:04pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/5 "2022-07-16T14:04:35Z")

</div>

Note: if you use a simple property binding from a number to a boolean, zero yields false, and non-zero yields true. If you tested further, you would have found that selecting beyond the first row would also have made your field visible.

---

<div class="post-metadata">

**Author:** ![batman01793](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@batman01793](https://forum.inductiveautomation.com/u/batman01793)\
**Post date:** [July 16, 2022, 2:14pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/6 "2022-07-16T14:14:26Z")

</div>

All records in my drop down =0 except for the non selected value this is -1  
my drop down is linked to a SQL table to show the data.

I’m not too sure how to write the expression you mentioned… I keep getting an error message

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b76faf2af2f12b89304b7dd021685a241211ea8d.jpeg)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [July 16, 2022, 2:16pm UTC](https://forum.inductiveautomation.com/t/how-to-make-vision-text-boxes-drop-down-selectors-be-hidden-unless-a-previous-step-has-a-value-input/61980/7 "2022-07-16T14:16:16Z")

</div>

Use `selectedIndex`, not `selectedValue`.

```auto
{Root Container.path.to.dropdown.selectedIndex} != -1

```
