# Change the Output between 0 and 1 on each message that I receive in the input

**URL:** <https://discourse.nodered.org/t/change-the-output-between-0-and-1-on-each-message-that-i-receive-in-the-input/48685>\
**Category:** General\
**Created:** [21 July 2021 04:17 UTC](https://discourse.nodered.org/t/change-the-output-between-0-and-1-on-each-message-that-i-receive-in-the-input/48685 "2021-07-21T04:17:53Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![badr\_al\_moragab](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@badr\_al\_moragab](https://discourse.nodered.org/u/badr_al_moragab)\
**Post date:** [21 July 2021 16:15 UTC](https://discourse.nodered.org/t/change-the-output-between-0-and-1-on-each-message-that-i-receive-in-the-input/48685/5 "2021-07-21T16:15:51Z")

</div>

Thanks @jbudd for your time to reply. your function works for me fine thanks for that. I still want the function 1 to store the last status ether it is "0" or "1" to change it on function 2 when signal 2 sent to it. As the Example shows bellow if Signal 1 pressed the function 1 will start to send "0", So when I press Signal 2 function 2 will have the change that function 1 sent so function 2 will send "1"

each function will get the last update on the other function. to let it as two way switch.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/f/ff05865e05d4d6173a0bc1f15b23d84de84fa9aa.png)

---

_[View the full topic](https://discourse.nodered.org/t/change-the-output-between-0-and-1-on-each-message-that-i-receive-in-the-input/48685)._
