# Adding tag bindings to components through scripting

**URL:** <https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 15, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447 "2024-05-15T16:11:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MSI\_EXP\_Auto](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MSI\_EXP\_Auto](https://forum.inductiveautomation.com/u/MSI_EXP_Auto)\
**Post date:** [May 15, 2024, 4:11pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447/1 "2024-05-15T16:11:25Z")

</div>

I have a startup script that is building a table dynamically. Right now I am just reading tag values and adding them to a big dictionary which I then set to the data property of the table. I want these values to be bidirectional bindings to the tags so that users can write to the tags directly from the table and the table stays updated. Will this be possible? I can't seem to find a way to write tag bindings through scripting.

---

<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:** [May 15, 2024, 4:20pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447/2 "2024-05-15T16:20:30Z")

</div>

1. Please tag your question as `vision` or `perspective`.
2. Is there any possibility of something else (PLC or other user) updating the tags? (This would present an extra challenge.)

---

<div class="post-metadata">

**Author:** ![MSI\_EXP\_Auto](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MSI\_EXP\_Auto](https://forum.inductiveautomation.com/u/MSI_EXP_Auto)\
**Post date:** [May 15, 2024, 4:24pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447/3 "2024-05-15T16:24:57Z")

</div>

Added the tag, it is perspective. The tags I want to allow edits on are in a UDT I created for alerts and alarms and those are only updated through Ignition. I could create a button that would push updates to the tags but that would not be as clean a solution

---

<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:** [May 15, 2024, 4:28pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447/4 "2024-05-15T16:28:31Z")

</div>

> [@MSI\_EXP\_Auto](#):
>
> write tag bindings through scripting.

You cannot in Perspective. (It is possible but challenging in Vision.)

Even if you could, a table component does not write back to itself, so any bidirectionality would never trigger. Tables delegate to scripts when cells are edited So, you **could** have the table perform the writeback that way.

But the canonical way to do this is with a table cell view renderer. The table would contain the tagpath in the column intended for data display/edit, and the corresponding entry in `props.columns[]` would set view rendering, and the view path. That view would receive the tag path in `view.params.value` and could then use bidirectional indirect binding on an entry field. This takes the editing out of the table and makes it happen with ordinary entry fields.

With this approach, the table's `props.data` is static.

---

<div class="post-metadata">

**Author:** ![MSI\_EXP\_Auto](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@MSI\_EXP\_Auto](https://forum.inductiveautomation.com/u/MSI_EXP_Auto)\
**Post date:** [May 15, 2024, 4:38pm UTC](https://forum.inductiveautomation.com/t/adding-tag-bindings-to-components-through-scripting/90447/5 "2024-05-15T16:38:49Z")

</div>

Hmm, I think this will work for me. I'll have to play around with it a little but thank you for the suggestion.
