# Message handler on different devices

**URL:** <https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404>\
**Category:** Ignition\
**Tags:** perspective, scripting\
**Created:** [March 7, 2025, 9:09pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404 "2025-03-07T21:09:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maryam\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Maryam\_Saeed](https://forum.inductiveautomation.com/u/Maryam_Saeed)\
**Post date:** [March 7, 2025, 9:09pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/1 "2025-03-07T21:09:56Z")

</div>

This is kind of urgent  
Lets say I have two devices Tab and Kiosk and need to send message handlers  
Everything is working on a single project  
I have a screen on tablet that has a submit button, I have script on those buttons, when i hit it, I have an onClick script that sends

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a896f5f3a9c7c9e65108840f1bd42d27a4ec3b05.png)

then I call this in my Gateway events message handler as

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/77f533a81fd56ae43704fae071cb0464c12fa979.png)

I then use this in my session events message handler

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/f/afc731f6c68c90b203dd45de4c467f472e8ba327.png)

then i call it onto configure events in my label with a string "PASSED" just for testing, else I need my status value from payload

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/64a44319cd02d7912685aaf4a4cf649c4cfb90dd.png)

This does not work and gives me an error. Am I doing something wrong? This is kind of urgent

---

<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:** [March 7, 2025, 9:33pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/2 "2025-03-07T21:33:24Z")

</div>

What error does it give you? Post it with the full stack trace, see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

~~Also, gateway scope has no concept of pages, you'll need to target `s` or `session` and create an appropriate handler in there.~~

Why not call the session `UpdateLabel` handler directly from the button instead of going through an additional gateway handler?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 7, 2025, 9:35pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/3 "2025-03-07T21:35:24Z")

</div>

You need to use [system.util.sendMessage | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-sendMessage) to send the message across different sessions.

---

<div class="post-metadata">

**Author:** ![Maryam\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Maryam\_Saeed](https://forum.inductiveautomation.com/u/Maryam_Saeed)\
**Post date:** [March 8, 2025, 4:11am UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/4 "2025-03-08T04:11:20Z")

</div>

This is what I'm trying. On my button I have system.util.sendMessage

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 8, 2025, 12:40pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/5 "2025-03-08T12:40:49Z")

</div>

Sorry... Missed that

I don't think you need the intermediate gateway event. Your Update label session message, I think, can be called directly from the system.util.sendMessage on your button with a scope of S.

You may want to add some logging info in there

If you still can't get it, we do this in a couple of our projects and I can provide an example later. I'm not in a position to show itnat the moment.

---

<div class="post-metadata">

**Author:** ![Maryam\_Saeed](https://avatars.discourse-cdn.com/v4/letter/m/a5b964/32.png) [@Maryam\_Saeed](https://forum.inductiveautomation.com/u/Maryam_Saeed)\
**Post date:** [March 9, 2025, 12:55pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/6 "2025-03-09T12:55:17Z")

</div>

I was wondering if I send a system.util.sendMessage with a scope S on my button, will all sessions on my gateway pick it? Considering I have two different devices thus two different sessions

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [March 9, 2025, 1:40pm UTC](https://forum.inductiveautomation.com/t/message-handler-on-different-devices/103404/7 "2025-03-09T13:40:24Z")

</div>

Yes. All of them should pick it up.
