# sendMessage from transform script in perspective

**URL:** <https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 25, 2022, 4:41am UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635 "2022-10-25T04:41:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [October 25, 2022, 4:41am UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/1 "2022-10-25T04:41:01Z")

</div>

Hi all,  
I'm trying to use system.perspective.sendMessage() from transform script that is made from property binding on component. I'm unable to call the messageHandler after several attempts.  
I'm I doing something wrong?

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [October 25, 2022, 6:41am UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/2 "2022-10-25T06:41:16Z")

</div>

It should be able to work. Are you sure you have specified all the parameters correctly, particularly the scope?

I would however recommend against doing such actions in a script transform. The intention of the script transform is to take the incoming value, manipulate or validate it, and return the modified result. Perhaps a change script is better suited.

---

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [October 25, 2022, 7:36am UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/3 "2022-10-25T07:36:35Z")

</div>

Yes, I had set the scope to 'session' in both places

I tried to change a parameter for the condition for which the sendMessage() should be executed and added the sendMessage() script on value change of the parameter. It still doesn't work.

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [October 25, 2022, 7:37am UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/4 "2022-10-25T07:37:56Z")

</div>

You will have to post the code of the message sender and handler

---

<div class="post-metadata">

**Author:** ![djs](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@djs](https://forum.inductiveautomation.com/u/djs)\
**Post date:** [October 26, 2022, 1:23pm UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/5 "2022-10-26T13:23:49Z")

</div>

Do you see anything in the logs?

Perhaps it is trying to handle the message but failing because of some mistake in the script. Those errors would be logged.

---

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [October 26, 2022, 4:06pm UTC](https://forum.inductiveautomation.com/t/sendmessage-from-transform-script-in-perspective/65635/6 "2022-10-26T16:06:44Z")

</div>

I had checked the logs, didn't find any errors.
