# Drop down, change of selection

**URL:** <https://forum.inductiveautomation.com/t/drop-down-change-of-selection/68142>\
**Category:** General Discussion\
**Tags:** vision\
**Created:** [January 3, 2023, 6:06am UTC](https://forum.inductiveautomation.com/t/drop-down-change-of-selection/68142 "2023-01-03T06:06:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 3, 2023, 4:07pm UTC](https://forum.inductiveautomation.com/t/drop-down-change-of-selection/68142/5 "2023-01-03T16:07:07Z")

</div>

If you are attempting this from the mouse clicked event handler, the problem is that the event fires before the index is selected. This is why it doesn't work on the first click but _does_ work on the second. Of course, by the second click, all of the other scripting is out of sequence.

The correct way to fire this script is from the propertyChange event handler. Simply take all of your code and nest it in the following `if` statement:

```auto
if event.propertyName == 'selectedIndex':

```

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/5127600c8f201b23294d1f50a1c18d05a55cf1ed.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/drop-down-change-of-selection/68142)._
