# Tag Updates within Perspective Table

**URL:** <https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999>\
**Category:** Ignition\
**Created:** [July 23, 2020, 2:14pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999 "2020-07-23T14:14:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 23, 2020, 2:14pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/1 "2020-07-23T14:14:11Z")

</div>

Hello,  
I am working with the table component of Perspective.  
The data displayed in the table comes from a binding with a script reading OPC Tags.

The solution may be very simple but I can’t figure it out : my issue is that after the data being imported in the table when starting the sesssion, the value of the tags won’t be updated unless the binding is refreshed.

Is there a way to dynamically show the tag value in the table components, using multiple OPC tags ?  
Should I have a timer to refresh the binding periodically ?

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [July 24, 2020, 12:07pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/2 "2020-07-24T12:07:26Z")

</div>

> [@amalric.sterlin](#):
>
> The data displayed in the table comes from a binding with a script reading OPC Tags.

Is it runScript() or a transform?

---

<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:** [July 24, 2020, 12:21pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/3 "2020-07-24T12:21:31Z")

</div>

> [@amalric.sterlin](#):
>
> Should I have a timer to refresh the binding periodically ?

Yes.

Reading tags in a script does not make a subscription. You must read repeatedly to keep the data fresh. Consider using custom properties with tag bindings to monitor the live tag values. Pass those properties to a script to assemble the dataset in the displayable form you like.

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 24, 2020, 12:45pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/4 "2020-07-24T12:45:48Z")

</div>

It is a transform

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 24, 2020, 12:46pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/5 "2020-07-24T12:46:24Z")

</div>

I will try this thank you !

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 24, 2020, 1:10pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/6 "2020-07-24T13:10:51Z")

</div>

Does this mean I have to create a custom property for each tag I want to monitor ?  
I have a thousand of 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:** [July 24, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/7 "2020-07-24T13:49:04Z")

</div>

Oy! A thousand props would be a bit much. Your current approach, but with a timed refresh, may be the best choice after all.

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 24, 2020, 1:52pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/8 "2020-07-24T13:52:32Z")

</div>

My issue is that I want to only refresh the value of the tags, but I have other data in my dataset that I want to keep.  
I figured a way to refresh only the values but this makes a “glitch” on the screen when updating, it lay be a timer issue.

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 28, 2020, 9:04am UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/9 "2020-07-28T09:04:57Z")

</div>

I have implemented a timer but when the value of the tag updates, the other values of the table reset as the table was first configured.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/e/2e3788c50d151599a5637bd9c2ec20a8dab5efff.png)

for exemple : I edit column\_4 to be True, and after the update of the column\_2 (which is every 5 seconds with my timer script), it comes back to False

I have an event on the table “onEditCellComit” to keep the edited value, and it works without the timer activated.  
Here is my timer script in a “onStartUp” event on the table :

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/a/3a8f228adc53ad6353e8776bda8e9b0ba2134fd5.png)

Is there a solution to prevent the other columns from reseting ?

---

<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:** [July 28, 2020, 11:58am UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/10 "2020-07-28T11:58:46Z")

</div>

Don’t use an infinite loop in any event! (Nor sleeping of any kind, though Perspective is more tolerant than Vision.)

Bind the `now(5000)` expression to a custom property to get a value that updates automatically every five seconds. Attach an `onChange` event to that property to run your tag update script.

---

<div class="post-metadata">

**Author:** ![amalric.sterlin](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@amalric.sterlin](https://forum.inductiveautomation.com/u/amalric.sterlin)\
**Post date:** [July 28, 2020, 12:43pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/11 "2020-07-28T12:43:18Z")

</div>

Thanks a lot !! It was really the missing part we needed !

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [July 31, 2020, 4:51pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/12 "2020-07-31T16:51:16Z")

</div>

Does it have to be a table? Can you use the flex repeater and create “rows” with it? You can then use indirect binding to display the value.

---

<div class="post-metadata">

**Author:** ![mjohnson](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@mjohnson](https://forum.inductiveautomation.com/u/mjohnson)\
**Post date:** [January 14, 2021, 5:54pm UTC](https://forum.inductiveautomation.com/t/tag-updates-within-perspective-table/36999/13 "2021-01-14T17:54:43Z")

</div>

Love this thread… Real big help! Thank you pturmel.
