# Auto-refresh table in perspective

**URL:** <https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430>\
**Category:** General Discussion\
**Created:** [August 14, 2019, 2:58pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430 "2019-08-14T14:58:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam.todorski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/adam.todorski/32/19388_2.png) [@adam.todorski](https://forum.inductiveautomation.com/u/adam.todorski)\
**Post date:** [August 14, 2019, 2:58pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/1 "2019-08-14T14:58:35Z")

</div>

I have a table in perspective that is populated by a script that goes and gets data from some tags and other places and calculates/formats things to display to the user. The table loads when the view is loaded in perspective but I want it to refresh ideally when one of the underlying tags changes. What’s the best way to do this? Even a simple loop updating the table every couple of seconds whether the tags have changed or not would be fine (though not ideal), but I can’t figure out how to do that.

---

<div class="post-metadata">

**Author:** ![adam.todorski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/adam.todorski/32/19388_2.png) [@adam.todorski](https://forum.inductiveautomation.com/u/adam.todorski)\
**Post date:** [August 14, 2019, 3:01pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/2 "2019-08-14T15:01:06Z")

</div>

PS - I tried calling self.refreshBinding(self.getSibling(“TableNameHere”).props.data) from a couple of different places but this yields the error “TypeError: refreshBinding(): 1st arg can’t be coerced to String” in the wrapper log.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 14, 2019, 3:25pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/3 "2019-08-14T15:25:18Z")

</div>

That’s not the appropriate syntax to call `refreshBinding` - it’s a component method, so you would go to the `sibling`, then call `refreshBinding(“props.data”):

`self.getSibling("TableNameHere").refreshBinding("props.data")`

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 14, 2019, 3:29pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/4 "2019-08-14T15:29:25Z")

</div>

If the table is global (no user specific items), another option might be to put the script in a Gateway Event Script (Timer or Tag Change) and write it to a dataset tag. Then point the perspective table to the tag.

---

<div class="post-metadata">

**Author:** ![joe.hammond](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@joe.hammond](https://forum.inductiveautomation.com/u/joe.hammond)\
**Post date:** [April 7, 2020, 7:53pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/5 "2020-04-07T19:53:28Z")

</div>

> [@paul-griffith](#):
>
> self.getSibling("TableNameHere").refreshBinding("props.data")

I am not clear on where this refreshBinding would be triggered. I can place this on a button and it refreshes but I need it to poll like a Tag, Query, or tag History. Example: every 30 seconds. Is there a session event that I can setup a timer?

Okay, i figured it out. The runScript('myscript', 30) has a polling parameter.

---

<div class="post-metadata">

**Author:** ![ahawes](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ahawes/32/36337_2.png) [@ahawes](https://forum.inductiveautomation.com/u/ahawes)\
**Post date:** [August 27, 2024, 2:05pm UTC](https://forum.inductiveautomation.com/t/auto-refresh-table-in-perspective/27430/6 "2024-08-27T14:05:30Z")

</div>

> [@joe.hammond](#):
>
> am not clear on where this refreshBinding would be triggered. I can place this on a button and it refreshes but I need it to poll like a Tag, Query, or tag History. Example: every 30 seconds. Is there a session event that I can setup a timer?

Awesome, i fixed that.
