# Property change

**URL:** <https://forum.inductiveautomation.com/t/property-change/12061>\
**Category:** General Discussion\
**Created:** [August 24, 2016, 8:31am UTC](https://forum.inductiveautomation.com/t/property-change/12061 "2016-08-24T08:31:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![P11](https://avatars.discourse-cdn.com/v4/letter/p/a9adbd/32.png) [@P11](https://forum.inductiveautomation.com/u/P11)\
**Post date:** [August 24, 2016, 8:31am UTC](https://forum.inductiveautomation.com/t/property-change/12061/1 "2016-08-24T08:31:13Z")

</div>

I have success in writing a script which writes a string on a label if a condition is true, BUT when the tag value changes, again, the string does not change according to the script but it remains static. WHY ?

```auto
value = system.tag.read("Depuratore/Gestione Motori/MXR VASCA 2/Sel_Modo_Aut_0_Man_V2").value
if value== 0:
	event.source.text = "STOP"
elif value == 1:
	event.source.text = "MANUALE"
else: event.source.text = "AUTOMATICO"
```

it change once !

---

<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:** [August 24, 2016, 11:06am UTC](https://forum.inductiveautomation.com/t/property-change/12061/2 "2016-08-24T11:06:19Z")

</div>

Where did you put this script? In other words, what makes it run when the tag changes value?  
Typically, I would bind the tag to a custom property (probably of the label in this case). Then use a property change event on that property name to run that script.  
Or better yet, use the switch() expression function.
