# Dropdown component Property change script triggered multiple times

**URL:** <https://forum.inductiveautomation.com/t/dropdown-component-property-change-script-triggered-multiple-times/16494>\
**Category:** Ignition\
**Created:** [January 5, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-property-change-script-triggered-multiple-times/16494 "2018-01-05T19:47:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbb5310](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jbb5310](https://forum.inductiveautomation.com/u/jbb5310)\
**Post date:** [January 5, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-property-change-script-triggered-multiple-times/16494/1 "2018-01-05T19:47:15Z")

</div>

I have a script component based upon a property change on a dropdown component.  
I have a simple

print selected label  
system.gui.messagebox("","")

for some reason the script runs twice whenever I select a different item on the dropdown list which would cause two message boxes to appear. Is there a way to prevent that script from running twice.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [January 5, 2018, 8:10pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-property-change-script-triggered-multiple-times/16494/2 "2018-01-05T20:10:49Z")

</div>

```auto
if event.propertyName=='selectedIndex':
   print selected.label

```

---

<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:** [January 5, 2018, 8:27pm UTC](https://forum.inductiveautomation.com/t/dropdown-component-property-change-script-triggered-multiple-times/16494/3 "2018-01-05T20:27:37Z")

</div>

Yeah, what Maynard said.  
Seriously, if a property change script doesn’t have `if event.propertyName.....` ahead of each block of code, it’s wrong.
