# Script to generate bindings

**URL:** <https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 8, 2025, 9:12am UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816 "2025-04-08T09:12:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Hervas\_Chico](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose_hervas_chico/32/69260_2.png) [@Jose\_Hervas\_Chico](https://forum.inductiveautomation.com/u/Jose_Hervas_Chico)\
**Post date:** [April 8, 2025, 9:12am UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/1 "2025-04-08T09:12:32Z")

</div>

Good day!

I have a table component in perspective, showing different tags of different equipment.  
Now for testing I have configured the DATA prop of the table manually, linking the fields with the Tags in the Tag browser.

But this is not going to be possible for hundreds of tags, so I would like to build an script to add this bindings automatically.

Is there a way to add a binding? for the moment I read the tags I need with system.tag.readblocking() and I assign those values to the prop.data of the table, but this is not a dynamic way to bind, if the tag changes, the value will not be shown.

Any idea?? thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![Fran\_Dujmovic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fran_dujmovic/32/70280_2.png) [@Fran\_Dujmovic](https://forum.inductiveautomation.com/u/Fran_Dujmovic)\
**Post date:** [April 8, 2025, 10:02am UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/2 "2025-04-08T10:02:52Z")

</div>

You can generate a dataset or an array of objects and bind that to the table's data property. Here's an example of the latter;

```python

folderPath = "[path/to/tags]"
tagPaths = system.tag.browse(folderPath)
tagObjects = []

for tag in tagPaths:
	tagPath = folderPath + "/" + tag["name"]
	tagValue = system.tag.readBlocking([tagPath])[0].value
	tagObject = {
		"tagName": tag["name"],
		"tagValue": tagValue
	}
	tagObjects.append(tagObject)

return tagObjects

```

You'd then configure 2 column objects `tagName` and `tagValue`. This will populate your table with tags from your tag provider. You can check out this thread, I think there could be a lot of useful info for you;

[Perspective table edit example, please - Ignition - Inductive Automation Forum](https://forum.inductiveautomation.com/t/perspective-table-edit-example-please/25050)

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 12:01pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/3 "2025-04-08T12:01:03Z")

</div>

If you don't need the values to be refreshed in "real time", you can generate the table by reading all the tags as described by @Fran_Dujmovic, and refresh it every x seconds.

If you want to have actual bindings to each tags, you can't script that in ignition, but you can generate the configuration with a script.  
You can configure a row, with its bindings, then copy the table and paste it in an editor so you can see what it looks like. It's in json format.  
Modify it with a script, then copy the resulting json and paste it back in your view.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 8, 2025, 12:04pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/4 "2025-04-08T12:04:42Z")

</div>

Fran, thanks for the link to my post. I don't think it's what Jose requires as it won't update if any of the tags change value.

I think the easiest option is,

- Create a simple coordinate view with a `tagPath` parameter.
- Add a Label Component to the view and create a tag binding on the label using the `tagPath` parameter.
- Render the table's value column as a view and select the view created above.
- Pass the tag path to the view instance.

You should be able to generate the list of instances by script fairly easily once you have the list of tags.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 12:07pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/5 "2025-04-08T12:07:28Z")

</div>

Eh I didn't think of that.  
I'm not sure if I love or hate it.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 8, 2025, 12:13pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/6 "2025-04-08T12:13:12Z")

</div>

> [@pascal.fragnoud](#):
>
> not sure if I love or hate it.

The table component has terrible behavioral side effects if it is fed changing information in `props.data`. Breaks row selection and paging, usually.

If you want "live" data in a table, use cell rendering views with indirect bindings inside.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 8, 2025, 12:14pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/7 "2025-04-08T12:14:42Z")

</div>

I see, thanks. I guess I love it then.

---

<div class="post-metadata">

**Author:** ![Fran\_Dujmovic](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fran_dujmovic/32/70280_2.png) [@Fran\_Dujmovic](https://forum.inductiveautomation.com/u/Fran_Dujmovic)\
**Post date:** [April 8, 2025, 12:27pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/8 "2025-04-08T12:27:56Z")

</div>

> [@Transistor](#):
>
> I don't think it's what Jose requires as it won't update if any of the tags change value.

Yeah I guess I misread that part, sorry. What Phil mentioned regarding the use of cell view renders is the way to go.

---

<div class="post-metadata">

**Author:** ![Jose\_Hervas\_Chico](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose_hervas_chico/32/69260_2.png) [@Jose\_Hervas\_Chico](https://forum.inductiveautomation.com/u/Jose_Hervas_Chico)\
**Post date:** [April 21, 2025, 8:54am UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/9 "2025-04-21T08:54:34Z")

</div>

Hello Phil!

thanks for your reply, It looks like this is the best solution but I don't understand how can I add a binding using a render cell view, could you please send me an example or clarify it a bit deeper for me as a beginner?

Thanks a lot in advance!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 21, 2025, 11:27am UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/10 "2025-04-21T11:27:44Z")

</div>

Start here:

> **[Table Column Configurations | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/table-column-configurations#embedding-a-view-in-a-table-cell)**
>
> This page contains examples that involve making changes to a table component's columns property.

Key points:

- In the view you create to be nested in the table to show the live data, make sure you define input parameters named `value` or `rowData`. (Exactly those names.)
- For testing that view, place a tag path in `value`, or a complete row of data from the table's `props.data` into `rowData`.
- Use indirect binding within the view to point at the correct tag for that cell.

---

<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:** [April 21, 2025, 12:33pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/11 "2025-04-21T12:33:29Z")

</div>

> [@Transistor](#):
>
> coordinate view

A flex would be more appropriate here

---

<div class="post-metadata">

**Author:** ![Jose\_Hervas\_Chico](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jose_hervas_chico/32/69260_2.png) [@Jose\_Hervas\_Chico](https://forum.inductiveautomation.com/u/Jose_Hervas_Chico)\
**Post date:** [April 21, 2025, 1:15pm UTC](https://forum.inductiveautomation.com/t/script-to-generate-bindings/104816/12 "2025-04-21T13:15:59Z")

</div>

Thanks!! I will investigate 🙂  
appreciate it!!!
