# Adding Tag Bindings to Components Through a Script

**URL:** <https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-a-script/97416>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 17, 2024, 6:49pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-a-script/97416 "2024-10-17T18:49:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [October 17, 2024, 7:51pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-a-script/97416/3 "2024-10-17T19:51:00Z")

</div>

If I'm correct in my assumption, consider the following approach:

Create a single template called something along the lines of `AnalogCardPoint` or similar. Create a parameter called `baseTagPath` and `index`. Create a custom property called tagValue. Create an indirect tag binding on `tagValue` that looks something like `{1}/{2}/Data`. In the box below the indirection string {1} should be linked to `baseTagPath` and {2} should be linked to `Index`

You can then take this template and use it in a template repeater. Create 2 custom properties on the template repeater called `baseTagPath` and `pointCount`. Create a property change script that has a first line that checks if `event.source.propertyName == "baseTagPath" or event.source.propertyName == "pointCount"`. If it does match, build a template paramters dataset with a row count that matches the value of `pointCount`, and place this dataset into the `templateParameters` property of the template repeater.

Technically you could make this template repeater into a template as well, and have `baseTagPath` as a template parameter.

From there, just place enough copies of the template repeater as there are I/O modules and adjust the `baseTagPath` and `pointCount` properties for each to match the respective card.

---

_[View the full topic](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-a-script/97416)._
