# Update template repeater property from template script

**URL:** <https://forum.inductiveautomation.com/t/update-template-repeater-property-from-template-script/20984>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [November 20, 2018, 8:50pm UTC](https://forum.inductiveautomation.com/t/update-template-repeater-property-from-template-script/20984 "2018-11-20T20:50:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![awaege](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@awaege](https://forum.inductiveautomation.com/u/awaege)\
**Post date:** [November 20, 2018, 8:50pm UTC](https://forum.inductiveautomation.com/t/update-template-repeater-property-from-template-script/20984/1 "2018-11-20T20:50:12Z")

</div>

So I have a template that contains a button as well as a number of other components. I have a template repeater on a window that then repeats anywhere from 2 - 12 of these templates. Is it possible to set a custom property on the template repeater based on clicking on one of the buttons? I want it to work almost like a simple multi-state button but can’t seem to get anything to work? Just wondering if this is possible and if so how I might go about doing it. Thanks.

---

<div class="post-metadata">

**Author:** ![jasko](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@jasko](https://forum.inductiveautomation.com/u/jasko)\
**Post date:** [November 21, 2018, 8:54am UTC](https://forum.inductiveautomation.com/t/update-template-repeater-property-from-template-script/20984/2 "2018-11-21T08:54:11Z")

</div>

I’m sure there is a better way but for now here a solution for you.

On the Template repeater, I set a custom property with the name state. And on the Template containing the button is also a custom property state. In the button action script is this:

```auto
try:
    event.source.parent.parent.parent.parent.parent.state = event.source.parent.state
except:
    pass

```

This writes the value of state from the button template to the template repeater.
