# Dynamic tag binding of an array though scripting

**URL:** <https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 18, 2026, 5:12pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037 "2026-02-18T17:12:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cafanto](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@cafanto](https://forum.inductiveautomation.com/u/cafanto)\
**Post date:** [February 18, 2026, 5:12pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/1 "2026-02-18T17:12:08Z")

</div>

Hello, I read in other threads that this is not possible, but I wanted to get some more information on other possible ways.  
I have a FlexRepeater with the “instances” array bound to a script that generates a list of arrays with this structure:  
`0:`  
` UDT:`  
` data: value`  
` MHE: value1`

The script basically gets the tag provider and selects some tags in a for loop to generate the instances of a template by returning a list with this structure

`udtInstances.append({`  
` 'MHE': tagName,`  
` 'UDT': {`  
` 'data': value,`  
` }`  
`})`

I need to bind the UDT array in my instances to different tags that the script selects. Can I pass through this script the binding information? Or can you point me in the right direction?

Any help would be appreciated.  
Thank you

---

<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:** [February 18, 2026, 5:18pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/2 "2026-02-18T17:18:58Z")

</div>

> [@cafanto](#):
>
> ` 'UDT': {`  
> ` 'data': value`

Wrong approach, configure your embedded view to accept a tag path string. Pass the UDT tag path to the embedded view. On your embedded view, use the base UDT tag path to drive indirect bindings for each of the necessary UDT members. Each member should have its own private custom property at the view level. Bind display/control elements to these custom properties as necessary.

> **[Indirect Tag Binding Mode​ - Tag Bindings in Perspective | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/tag-bindings-in-perspective#indirect-tag-binding-mode)**
>
> A Tag binding is a straight-forward binding type. It simply binds a property directly to a Tag Property (typically the value). This sets up a subscription for that tag. Every time the chosen tag changes, the binding is evaluated and pushes the new...

While this is for a popup, the exact same method can be used for views in a repeater:

> **[Passing Tag Paths to a Popup Video at Inductive University](https://inductiveuniversity.com/videos/passing-tag-paths-to-a-popup/8.1)**
>
> Learn how to pass a tag path to a popup view and use that tag path to construct indirect tag bindings.

While this link is for vision, the same logic can be applied to perspective:

> **[Template Indirection | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/ignition-modules/vision/vision-templates/template-indirection)**
>
> Indirection in Templates

---

<div class="post-metadata">

**Author:** ![emmanuelsrlok](https://avatars.discourse-cdn.com/v4/letter/e/59ef9b/32.png) [@emmanuelsrlok](https://forum.inductiveautomation.com/u/emmanuelsrlok)\
**Post date:** [February 18, 2026, 6:57pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/3 "2026-02-18T18:57:20Z")

</div>

1. Use tag function system.tag.browse using the folder path, you can use the filter parameter to get a specific UDT type.

```python
folder_path = "[path]to_folder"
output = []
results = system.tag.browse(folder_path) 
for result in results:
  output.append(result['fullPath'])

```

1. With that result you can create an array of tag paths, and add the tag address.

```python
tags_to_read = []
for path in output:
  tags_to_read.append(str(path) + '/Val')

```

1. With that array of tagpaths, use a system read function to get all the values,

```python
qualifiedValues = system.tag.readBlocking(tags_to_read)

```

1. You'll get an array of values, with that array you can create a flex repeater with the format you need.

> Be careful with the system.tag.readBlocking function, this function creates a thread in the gateway, don't use it with constant generated data, this is perfect to get the configuration, if you need to have a constant reading it's better to use system.tag.readAsync.

> **[system.tag.browse | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-browse)**
>
> Returns a list of nodes found at the specified path.

> **[system.tag.readBlocking | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-readBlocking)**
>
> Reads the value of the tags at the given paths.

---

<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:** [February 18, 2026, 7:09pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/4 "2026-02-18T19:09:50Z")

</div>

> [@emmanuelsrlok](#):
>
> constant reading it's better to use system.tag.readAsync.

This is incorrect and inefficient, if you need anything other than a value snapshot, you should be utilizing (indirect) tag bindings. If the values are being displayed via embedded views, the bindings should be configured in the embedded view and generated from the tag path(s) passed to the embedded view as parameters.

Edited to clarify

---

<div class="post-metadata">

**Author:** ![emmanuelsrlok](https://avatars.discourse-cdn.com/v4/letter/e/59ef9b/32.png) [@emmanuelsrlok](https://forum.inductiveautomation.com/u/emmanuelsrlok)\
**Post date:** [February 18, 2026, 7:26pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/5 "2026-02-18T19:26:15Z")

</div>

Fair point, Ryan. Indirect tag bindings are definitely more efficient for standard UI displays. However, since we don't know exactly how many tags need to be read, configuring individual bindings would be inefficient. As he mentioned needing these for a Flex Repeater, another alternative would be to pass the tagPath to the repeater and let the child view handle the indirect tagging. That said, I find that scripting often provides better maintainability when dealing with dynamic arrays that reads more that just one value of the UDT. But you're right, for a single value snapshot, bindings are the way to go.

---

<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:** [February 18, 2026, 7:39pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/6 "2026-02-18T19:39:02Z")

</div>

> [@emmanuelsrlok](#):
>
> configuring individual bindings would be inefficient

It appears I was unclear, I was advising to create the indirect tag bindings on the embedded view as you mentioned. I've edited my comment to prevent confusion.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 19, 2026, 12:28am UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/7 "2026-02-19T00:28:23Z")

</div>

> [@emmanuelsrlok](#):
>
> However, since we don't know exactly how many tags need to be read, configuring individual bindings would be inefficient.

This is what @pturmel ‘s [Integration Toolkit](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934) module solves with the `tags` expression function which accepts a list of tagpaths to create bindings to

---

<div class="post-metadata">

**Author:** ![cafanto](https://avatars.discourse-cdn.com/v4/letter/c/439d5e/32.png) [@cafanto](https://forum.inductiveautomation.com/u/cafanto)\
**Post date:** [March 3, 2026, 5:12pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/8 "2026-03-03T17:12:57Z")

</div>

Thanks for the replies but I can’t seem to make it work. I will explain what I did so far:

I have a few tag providers that each have an UDT (the same for all tag providers) and each tag provider has multiple tag instances of this UDT.

I need to populate a flexrepeater with the correct number of UDT instances depending on the tag provider.

There is a template view that I created that is going to be repeated on the flexrepeater, with basically only a MultiStateButton whose values need to change dinamically (to make the colors of the buttons change) depending on the values from the tags (each instance on the flexrepeater should correspond to a tag).

By now I created a transform script that binds to the flexrepeater (view.props.instances) and takes the CurrentTagProvider global property and returns a list with all the UDT instances that I need.

 ![foto111](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/0/604ce69737c79ce5a30db5913094149d51ad370b.png)

So I get the correct number of template instances on the flexrepeater, but now I don’t know how to make the template change state only having the basePath as a variable to use.

From what I understood from the previous replies, in the template view I tried to bind the value of a button indirectly to the tag:  
Binding on the MultiStateButton.props.states[0].value: {1}/OPC/JAM1\_LAT  
With {1} being {view.params.basePath}

 ![foto111](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b71a77fc6005ddd7cee02a5a48aa8faba22467c.png)

I get an error on the preview that says Bad\_Not\_Found and on the flex repeater it doesn’t populate the page with the correct values from the tags

---

<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:** [March 3, 2026, 5:33pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/9 "2026-03-03T17:33:02Z")

</div>

Based on your images you are not passing a proper tag path as the base path, and you are not constructing a proper tag path in the indirect binding. The base path should look more like `[provider]folder/tag` or `[provider]folder` based on your current indirect binding. The base path you are passing currently is missing the provider.

The other option would be to pass both the base tag path and the tag provider as params to the template, and then you could modify your indirect binding to be `[{0}]{1}/OPC/SomeUdtMemberHere`, with {0} = tag provider and {1} = base tag path

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 3, 2026, 8:40pm UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/10 "2026-03-03T20:40:58Z")

</div>

> [@ryan.white](#):
>
> The base path you are passing currently is missing the provider.

You don't need the tag provider though. If you exclude it it will use the project's default tp

---

<div class="post-metadata">

**Author:** ![lane.duncan](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lane.duncan/32/83700_2.png) [@lane.duncan](https://forum.inductiveautomation.com/u/lane.duncan)\
**Post date:** [March 4, 2026, 4:48am UTC](https://forum.inductiveautomation.com/t/dynamic-tag-binding-of-an-array-though-scripting/114037/11 "2026-03-04T04:48:35Z")

</div>

> [@ryan.white](#):
>
> The other option

Another option is to construct the entire tag path in the view.custom properties, then set your indirect tag path to the custom property.

This will allow you some extra debug tools, like printing to the output console when the view loads.
