# Script to add binding in perspective

**URL:** <https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 19, 2025, 10:49am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547 "2025-02-19T10:49:37Z")\
**Posts on this page:** 8\
**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:** [February 19, 2025, 10:49am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/1 "2025-02-19T10:49:38Z")

</div>

Good morning,

I would like to generate a table in an automatic way.  
For that I would like to write an script that generates the bindings of the table to map different cells with Tags.

Is there any way to do that? I dont want to spend 4 days adding tags to the table.

Thanks in advance

---

<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:** [February 19, 2025, 11:00am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/2 "2025-02-19T11:00:15Z")

</div>

The table component is not ideal for this. Usually we want the table to update if the `data` changes. This can happen automatically if a binding is applied to the `data` property _if_ the tag is referenced in the binding. The binding is added to a subscription to that tag and any time the tag changes the binding re-evaluates. (Referencing it in a binding transform doesn't do this, so a script transform won't subscribe.)

Explain some more how you want this to work.

---

<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:** [February 19, 2025, 11:13am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/3 "2025-02-19T11:13:07Z")

</div>

I want to display on a table the GPS position of different vehicles, this GPS (latitude and longitude) are tags in the tag browser. But I have more than 100 hundred vehicles. So I would like to automate the binding generation to the DATA property of the table.

---

<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:** [February 19, 2025, 11:17am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/4 "2025-02-19T11:17:20Z")

</div>

OK, so you could create an expression binding with `now(30000)` (which will trigger every 30 s) and write a script transform on that to create the data. Is this what you have in mind?

Why not [Perspective - Map | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-map) instead of a table? It would make a lot more sense.

---

<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:** [February 19, 2025, 11:41am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/5 "2025-02-19T11:41:58Z")

</div>

Thanks a lot! great idea, works fine.

The map is good if you want to display on a map, but this is not the case, we need it in a table format.

Deeply appreciate your tip!!

---

<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:** [February 19, 2025, 11:45am UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/6 "2025-02-19T11:45:11Z")

</div>

Good - although I can't imagine what use a table of grid coordinates is, unless you're launching missiles at them.

---

<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:** [February 19, 2025, 1:18pm UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/7 "2025-02-19T13:18:54Z")

</div>

Be aware that if you repeatedly regenerate a Perspective Table's `props.data` in this manner, the table will be extremely annoying for the user, because any row selections or paging will be lost when the binding updates.

Make the table have a column for the static tag paths to the coordinate tags. Set those columns to use "view" render mode, and point the cells at a nestable view that can indirect bind to the tag for the dynamic display.

---

<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:** [February 19, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/script-to-add-binding-in-perspective/102547/8 "2025-02-19T14:05:34Z")

</div>

Amazing, thanks for the consideration! works great!
