# Looking for clarity around util.sendMessage() scopes

**URL:** <https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042>\
**Category:** Ignition\
**Tags:** perspective, vision, scripting\
**Created:** [June 17, 2026, 4:53pm UTC](https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042 "2026-06-17T16:53:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TT-ignit](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TT-ignit](https://forum.inductiveautomation.com/u/TT-ignit)\
**Post date:** [June 17, 2026, 4:53pm UTC](https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042/1 "2026-06-17T16:53:13Z")

</div>

Hello all.

I'm a bit confused about the meaning of the various scope options provided by [the system.util.sendMessage()](https://www.docs.inductiveautomation.com/docs/8.3/appendix/scripting-functions/system-util/system-util-sendMessage#scope) function.

As the documentation states, the `scope` argument:

> Limits the scope of the message delivery to "C" (clients), "G" (Gateway), "CG" for clients and the Gateway, or "S" Session. Any combination of C, G, and S are available. Defaults to "CS" if the user name, role, or host name parameters are set, and to "CGS" if none of these parameters are set. [optional]

Casually reading this left me pretty confused, especially coming from [perspective.sendMessage()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-sendMessage), which apparently accepts `session` as a scope argument but ignores it?

So I did [some digging on the forums](https://forum.inductiveautomation.com/t/system-util-sendmessage-perspective-scripting/38799/6), which has mostly made me more confused because the terminology [seems overloaded](https://forum.inductiveautomation.com/t/system-perspective-sendmessage-function/73047/14). [I've gathered](https://forum.inductiveautomation.com/t/how-to-send-message-from-gateway-to-perspective-session/38811/4) that for the purposes of sending a message from a view to all people with that view open I should be using the session scope in `util.sendMessage()`, but the answers I saw left me wondering what that scope actually is and why it is called a session scope.

Looking at the Designer, I can see that under Perspective there are Gateway Events and Session Events. It seems to me that I can create handlers more or less identically, though the Gateway Event has a lot more contextual information. I'm guessing that "Clients" are a Vision concept, which I am totally unfamiliar with.

If someone would be willing to explain each of the three scopes and how the messages reach handlers in detail I would be greatly appreciative.

---

<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 17, 2026, 5:08pm UTC](https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042/2 "2026-06-17T17:08:23Z")

</div>

Yes, the "Client" scope for `system.util.sendMessage` is purely for Vision clients. (Created back in the day, before Perspective was a gleam in IA's eye.)

`system.util.sendMessage`'s Session scope **only** sends to session message handlers, not to any components.

`system.perspective.sendMessage` does **not** send to session message handlers, just to components. Its "session" scope is distinct.

---

<div class="post-metadata">

**Author:** ![TT-ignit](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TT-ignit](https://forum.inductiveautomation.com/u/TT-ignit)\
**Post date:** [June 17, 2026, 5:20pm UTC](https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042/3 "2026-06-17T17:20:57Z")

</div>

I think I'm still confused about what a "session" is. When I read this page: [Perspective Sessions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/perspective-sessions)

I come away with the impression that a Session is started once per browser per project. A page is subordinate to that session, and so on.

Given that, I would think that the way `util.sendMessage()` works when targetting the session scope would be either:

- The message is sent to a specific session ID that would need to be supplied. I think this is what `perspective.sendMessage()` does?
- The message is broadcast across the entire gateway in a band that session event handlers have access to.

I believe it's the second for `util.sendMessage()`, now. But then what is the purpose of the gateway scope? When should I use it?

---

<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:** [June 17, 2026, 5:34pm UTC](https://forum.inductiveautomation.com/t/looking-for-clarity-around-util-sendmessage-scopes/116042/4 "2026-06-17T17:34:39Z")

</div>

You would use `util.sendMessage` to gateway scope to:

1. From a Vision client or Designer, invoke some action on the gateway (because their scripts run truly local to the machine where they are)
2. Broadcast a message over the gateway network **to another gateway entirely**.
