# Template Repeater - Script to update Custom Property?

**URL:** <https://forum.inductiveautomation.com/t/template-repeater-script-to-update-custom-property/9521>\
**Category:** Ignition\
**Created:** [January 9, 2015, 5:53pm UTC](https://forum.inductiveautomation.com/t/template-repeater-script-to-update-custom-property/9521 "2015-01-09T17:53:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paullys50](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paullys50/32/3324_2.png) [@Paullys50](https://forum.inductiveautomation.com/u/Paullys50)\
**Post date:** [January 9, 2015, 5:53pm UTC](https://forum.inductiveautomation.com/t/template-repeater-script-to-update-custom-property/9521/1 "2015-01-09T17:53:20Z")

</div>

I am using a template and template repeater.

For simplicity, I’ll call the template “circle”  
On the “circle” template I have a customer property called “status”.

If I use the template repeater, have it repeat 10 instances of the template “circle” I also have 10 instances of the “circle.status” custom property.

Is it possible, through scripting to manipulate all 10 instances of “circle.status” based on a mouse click on a any one of the templates in the template repeater? Code example:

```auto
# In the Event Handler: mouse/mouseReleased the following script would be called
if circle #1.status == 1:
   circle #2.status = 0
   circle #3.status = 0
   circle #4.status = 0
   circle #5.status = 0
   circle #6.status = 0
   circle #7.status = 0
   circle #8.status = 0
   circle #9.status = 0
   circle #10.status = 0
```

Because the script is embedded on the template itself, it won’t have any reference to the other templates in the repeater correct? So I’m not sure I can do something like this at the template level…probably something at the template repeater level?

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [January 12, 2015, 5:16pm UTC](https://forum.inductiveautomation.com/t/template-repeater-script-to-update-custom-property/9521/2 "2015-01-12T17:16:12Z")

</div>

In the mouse \> clickedEvent of the template add:

`for comp in event.source.parent.getComponents():
	comp.setPropertyValue("Status",0)
event.source.Status = 1`
