# Send a message from a gateway script to the perspective sessions

**URL:** <https://forum.inductiveautomation.com/t/send-a-message-from-a-gateway-script-to-the-perspective-sessions/75494>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [June 24, 2023, 10:16am UTC](https://forum.inductiveautomation.com/t/send-a-message-from-a-gateway-script-to-the-perspective-sessions/75494 "2023-06-24T10:16:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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 24, 2023, 12:30pm UTC](https://forum.inductiveautomation.com/t/send-a-message-from-a-gateway-script-to-the-perspective-sessions/75494/2 "2023-06-24T12:30:29Z")

</div>

A memory tag that you update just after the data is saved in the database is probably the simplest method. (I would use a datetime memory tag and write `system.date.now()` to it.) The consumers in the UI would use a tag binding on a session or view or component custom property, with a change event to perform the necessary UI operations to redisplay content (probably a `.refreshBinding()` method call where the named query resides to make it run again).

The only downside to the memory tag approach is that binding evaluation will likely double-execute the query on view startup.

A more complicated approach that avoids that problem would be to broadcast a message after saving in the database, and having message handlers cause the content redisplay. Take a close look at this topic, and the behavioral differences between `system.util.sendMessage()` and `system.perspective.sendMessage()` in regards to gateway scope broadcasts:

> [@system.perspective.sendMessage() function](https://forum.inductiveautomation.com/t/system-perspective-sendmessage-function/73047):
>
> Has anyone been able to use the system.perspective.sendMessage() function when it is triggered by a tag change event? TIA

---

_[View the full topic](https://forum.inductiveautomation.com/t/send-a-message-from-a-gateway-script-to-the-perspective-sessions/75494)._
