# Iterative tag expression binding

**URL:** <https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711>\
**Category:** Ignition\
**Created:** [November 9, 2018, 1:19pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711 "2018-11-09T13:19:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsui](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dsui](https://forum.inductiveautomation.com/u/dsui)\
**Post date:** [November 9, 2018, 1:19pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711/1 "2018-11-09T13:19:20Z")

</div>

I am trying to bind about 360 identical multi-state indicators to a series of iterative OPC tag data structures. In this case, the state of Indicator 1 would bind to an expression based off Tag 1/Item A and Tag 1/Item B, Indicator 2 binds to an expression with Tag 2/Item A and Tag 2/Item B, and so on (until Indicator 360 binds to Tag 360). Is there a way to set the expression based off the name of the component, rather than manually creating the expressions for all 360 indicators?

---

<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:** [November 9, 2018, 2:46pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711/2 "2018-11-09T14:46:51Z")

</div>

You can do this using UDT parameters.  
Add a parameter called TagIndex, then just reference that in the OPC Item Path of the tag in the UDT.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/3/3514467d76299b43792fd764369437ab5146424c.PNG)  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4b0453f6ae13eb5a152df443b96edc0dd0d96d94.PNG)  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/8/83dc5df50274f7969b0cc947f4a32ba11e3564c5.PNG)  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a2cdaaaf16847474a61ce979f0c86c6f68779de2.PNG)

Then you just create the tags based off the UDT and assign the TagIndex on the created tag.

---

<div class="post-metadata">

**Author:** ![dsui](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dsui](https://forum.inductiveautomation.com/u/dsui)\
**Post date:** [November 9, 2018, 4:48pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711/3 "2018-11-09T16:48:21Z")

</div>

I feel that I’m in a slightly different scenario. As a simpler example, I made a UDT called Test, with items TagA and TagB and parameter Index. There are then four instances of Test, where Index goes from 1 to 4.

In my main window, there are four numeric labels called Num1 through Num4 that take the sum of TagA and TagB. I use the property binding on the data value to make an expression for Num1. In this case, I was wondering if there was a way to substitute Test\_1 in the property binding expression based on the data type parameter and label name? This way, Num1 could be copied to make Num2 through Num4 that would reference Test\_2 through Test\_4 respectively (instead of continuing to reference Test\_1)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1ec540a1d48dcd4cadc4a182124c6d1f18086591.PNG)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d101dee59f0158296abf2de0098888ba8357469d.PNG)

---

<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:** [November 9, 2018, 5:29pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711/4 "2018-11-09T17:29:37Z")

</div>

Create the expression tag inside of the UDT to do the calculation, then do a Template tied to the UDT where you can pass it any other calculations you want. Then you can use a template repeater or a template canvas to display as many of them as you want without having to draw and configure each one.

you should go through the Vision Templates course  
[https://www.inductiveuniversity.com/course/templates](https://www.inductiveuniversity.com/course/templates)

Or you can use indirect addressing on the label controls to do the same.

---

<div class="post-metadata">

**Author:** ![dsui](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@dsui](https://forum.inductiveautomation.com/u/dsui)\
**Post date:** [November 9, 2018, 7:47pm UTC](https://forum.inductiveautomation.com/t/iterative-tag-expression-binding/20711/5 "2018-11-09T19:47:24Z")

</div>

Looks like the Vision Templates course goes over what I’m trying to do. Thanks!
