# Perspective Send Message to all other opened clients

**URL:** <https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 1, 2024, 10:55am UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084 "2024-02-01T10:55:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ToMakPo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tomakpo/32/23875_2.png) [@ToMakPo](https://forum.inductiveautomation.com/u/ToMakPo)\
**Post date:** [February 1, 2024, 10:55am UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/1 "2024-02-01T10:55:53Z")

</div>

I am trying to push a message to all other opened clients when a button is pushed.

I have a script on my button:

```auto
projectName = system.util.getProjectName()
system.util.sendMessage(
	project = projectName, 
	messageHandler = 'pushUpdate', 
	payload = {'displayId': displayId},
	scope = 'S'
)

```

Then on the Session Events \> Message \> "pushUpdate":

```auto
system.perspective.sendMessage(
	messageType = 'getUpdate', 
	payload = payload, 
	scope = 'session'
)

log = system.util.getLogger('session event log')
log.info('session events message called') # <-- This does show up in the logs.

```

Then on the view that I would like to listen for the `getUpdate` message:

```auto
system.perspective.print('gotUpdate') # <-- This does not show up in the client.

```

Yes, the Session scope is checked for this.

What am I missing?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [February 1, 2024, 11:16am UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/2 "2024-02-01T11:16:16Z")

</div>

Are all clients using the same session ? That seems unlikely to me.

Can you describe what you're trying to do ?

---

<div class="post-metadata">

**Author:** ![ToMakPo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tomakpo/32/23875_2.png) [@ToMakPo](https://forum.inductiveautomation.com/u/ToMakPo)\
**Post date:** [February 1, 2024, 3:16pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/3 "2024-02-01T15:16:51Z")

</div>

No. All clients would be using different computers in different parts of the plant. If a change is made in HQ, all clients with relevant information should be updated to show the updated info. I can't use tags.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [February 1, 2024, 3:39pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/4 "2024-02-01T15:39:02Z")

</div>

Well, you've very clearly passed "`session`" as the scope. You can't expect OTHER sessions to receive the message too...

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 1, 2024, 3:46pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/5 "2024-02-01T15:46:29Z")

</div>

> [@ToMakPo](#):
>
> I can't use tags.

Why not?  
Alternatively, what triggers the update?

---

<div class="post-metadata">

**Author:** ![ToMakPo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tomakpo/32/23875_2.png) [@ToMakPo](https://forum.inductiveautomation.com/u/ToMakPo)\
**Post date:** [February 1, 2024, 4:06pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/6 "2024-02-01T16:06:45Z")

</div>

I can't because my client doesn't want it. I don't know why.

---

<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:** [February 1, 2024, 4:07pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/7 "2024-02-01T16:07:37Z")

</div>

Actually, `session` is the correct scope for the `system.util.sendMessage()`.

How is the `getUpdate` handler configured on the view?

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [February 1, 2024, 5:32pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/8 "2024-02-01T17:32:21Z")

</div>

It looks like OP is using `system.perspective.sendMessage()`, not `util.sendMessage()`, and in that case, the `session` scope is not sufficient for what OP wants.

EDIT oops I'm blind

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [February 1, 2024, 5:41pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/9 "2024-02-01T17:41:55Z")

</div>

He's using both actually.

I barely ever use the `util` one, I'll have to play with it a bit and see how it works before I can be of any help here.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [February 1, 2024, 9:36pm UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/10 "2024-02-01T21:36:50Z")

</div>

~~Are there any errors in the gateway logs? Is your event handler on your component expecting the message set to accept session scoped messages (by default they are only set to page level)~~

Man I need to read better. You might need to supply a pageId? But it says it should use the current page by default so I'm not sure. Are you sure your message handler on your view is called 'getUpdate' and not something else?

Every time I've had an issue with message handlers I find out I either got the name wrong or targeted a message handler that I changed the name of later.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [February 2, 2024, 3:04am UTC](https://forum.inductiveautomation.com/t/perspective-send-message-to-all-other-opened-clients/85084/11 "2024-02-02T03:04:41Z")

</div>

First thoughts:

1. Verify that the View you're working with is part of the same project as the originating broadcast done with the `system.util` call. It sounds like it since you're seeing the session-level logging, but I have to make sure.
2. Is the View you're testing with open in a session _outside the Designer_? Message Handlers don't work within the Designer if I recall correctly.
3. Is the View a Docked View? A Popup? For the View to hear the message, it MUST be present in the DOM of the browser. Collapsed Docked Views can be removed from the DOM depending on the configuration of the Page (if some other Docked View on the same side was the last one expanded for the side).

We have automated testing in place for this EXACT scenario, so there must be a logical explanation.
