# Refresh Data Across All Sessions

**URL:** <https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 9, 2024, 8:04pm UTC](https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976 "2024-07-09T20:04:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [July 9, 2024, 8:04pm UTC](https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976/1 "2024-07-09T20:04:52Z")

</div>

Hi,

I am trying to find a way to refresh data across all sessions of a perspective application. The current way in development is that there is a global tag `RefreshData` that gets turned on/off based on actions by users. The issue with that is we are noticing if 2 people are writing to that tag at the same time, it is likely not going to refresh for the second person that needs to refresh their data. It is currently writing the tag high, sleeping for a second, and turning the tag off. Which is why we are noticing this issue. Is there any supported way to send a message across all sessions no matter what / not use a sleep as a method of forcing this delay needed to detect the change to the tag?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 9, 2024, 8:41pm UTC](https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976/2 "2024-07-09T20:41:52Z")

</div>

Why not use `system.util.sendMessage()` instead of a tag?

> **[system.util.sendMessage | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-sendMessage)**
>
> This function sends a message to clients running under the Gateway, or to a project within the Gateway itself.

---

<div class="post-metadata">

**Author:** ![Colin\_Quinn](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@Colin\_Quinn](https://forum.inductiveautomation.com/u/Colin_Quinn)\
**Post date:** [July 9, 2024, 9:02pm UTC](https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976/3 "2024-07-09T21:02:56Z")

</div>

I was looking at that just a bit ago, how does that integrate into every session? Looks like it'd need to have a session event handler that reaches out to every binding single binding that needs to be refreshed. But I'm unclear (just learning about this functionality right now) on how that message handler has context to every component that may or may not be loaded per session.

Here's a use case I am looking at. I have different tables on 2 different views, if user 1 has view 1 open and user 2 has view 2 open. User 1 enters some new data and needs to refresh user 2's view/table. How would the message handler know what sessions have what views/properties available to refresh?

Or is it as simple as

```python
system.util.sendMessage(project, refreshData, 'S')

```

with a message handler on any component that needs to listen for that `refreshData` message where that component can refresh itself?

---

<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:** [July 9, 2024, 9:18pm UTC](https://forum.inductiveautomation.com/t/refresh-data-across-all-sessions/92976/4 "2024-07-09T21:18:58Z")

</div>

> [@Colin\_Quinn](#):
>
> with a message handler on any component that needs to listen for that `refreshData` message where that component can refresh itself?

This, but you need an intermediate session message handler to catch the outgoing from system. **util**.sendMessage and broadcast it again with system. **perspective**.sendMessage. More on that here:

> [@Session Event Handlers on inheritable projects](https://forum.inductiveautomation.com/t/session-event-handlers-on-inheritable-projects/91140/5):
>
> Note that there's two different 'messaging' systems at play, which causes lots of confusion, unfortunately. system.util.sendMessage is the older, not-Perspective-specific, bus that was 'overloaded' to allow messaging to entire Perspective sessions. The handlers for these messages are defined in 'Session Events', and as Phil noted - not generally suitable for participation in the project inheritance scheme currently; all your handlers, of any type, are all managed by a single project resource, …
