# \[Perspective\] Refresh binding doesn't work using message handler

**URL:** <https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 26, 2023, 12:19pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521 "2023-06-26T12:19:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mrk](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mrk](https://forum.inductiveautomation.com/u/Mrk)\
**Post date:** [June 26, 2023, 12:19pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521/1 "2023-06-26T12:19:17Z")

</div>

Hello all,

I'm trying to populate a table using a binding and a script transform.  
The script is performing a "tagBrowse" in a folder and parsing all required data:

 ![Screenshot 2023-06-26 142032](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/a/0a6e2af7b020e0826884ee6fd8e885897e3a0fdf.png)

Everything is working as expected but I'm not able to use the message handler to refresh the binding and let the script run again to browse the tags again.  
This is the "Script Configuration":

 ![Screenshot 2023-06-26 141537](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/b/2b23a5ef68a0e6543ff1c7418b0982f5e785e702.png)

And this is how I'm temporary trying to trigger the message handler using a button:

 ![Screenshot 2023-06-26 141559](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8dedb64041571778feb187230dd6b050e6af2d2.png)

I'm probably missing something  
Any help will be appreciated.  
Thanks 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:** [June 26, 2023, 12:23pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521/2 "2023-06-26T12:23:39Z")

</div>

Refresh doesn't really do anything to a tag binding. They always auto-refresh with new data. Refresh will only re-run a transform on a binding if the binding itself gets a new value.

Consider moving that script transform to a project library function and calling it separately where needed. Perhaps as a `runScript()` binding instead of a tag binding.

---

<div class="post-metadata">

**Author:** ![Mrk](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mrk](https://forum.inductiveautomation.com/u/Mrk)\
**Post date:** [June 26, 2023, 12:33pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521/3 "2023-06-26T12:33:00Z")

</div>

Thanks for your help, it is clear now the reason why the table was not updating.  
Regarding the script unfortunately due to some restriction in our environment I can't run script in the project library, so I need to find a different way to achieve 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:** [June 26, 2023, 12:38pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521/4 "2023-06-26T12:38:11Z")

</div>

> [@Mrk](#):
>
> due to some restriction in our environment I can't run script in the project library

That sounds more than a bit strange. Not being able to leverage project script functions to reduce code duplication would be an extraordinarily bad policy. You should get that restriction lifted.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [June 26, 2023, 1:11pm UTC](https://forum.inductiveautomation.com/t/perspective-refresh-binding-doesnt-work-using-message-handler/75521/5 "2023-06-26T13:11:44Z")

</div>

> [@Mrk](#):
>
> it is clear now the reason why the table was not updating

Thought that I should also mention running a browse operation like this directly in a script transform is potentially crushing your performance, depending on how many tags are within `'[default]Trucks'`, not to mention you're doing tag operations on paths that are potentially not actually tags.

Also, you loop through these results and then run two read operations each time through the loop. At a minimum that should look like:

```auto
tagRead, PLC = system.tag.readBlocking([strTagPath + '/expression/ActiveAlarms',strTagPath + '/Parameters.PLC'])

```

However, I would strongly consider building a list of all tag paths and then reading them all at once.
