# Send message to button from within a function node?

**URL:** https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275
**Category:** General
**Created:** [1 September 2020 03:08 UTC](https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275 "2020-09-01T03:08:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [1 September 2020 03:08 UTC](https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275/1 "2020-09-01T03:08:53Z")

</div>

I searched for an example on this, but did not seem to find a match? Send message to known named button from within a function node? I have a group of buttons I need to initialize based on some calculations done in a function node, figure I could just initialize the buttons as I do the calculations, if the above question is possible?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 September 2020 06:19 UTC](https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275/2 "2020-09-01T06:19:12Z")

</div>

Can't you just connect wires in the normal way?

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [1 September 2020 15:57 UTC](https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275/3 "2020-09-01T15:57:12Z")

</div>

Yup, i did actually, and built an array of the buttons that needed the message, and returned that from the function node. I had the button list, from how the UI is initialized on NR start. So if I add or remove a button, the code adapts. Which is a better 'NR' wire design than what I was thinking I wanted to do when I posed the question. At times, I tend to revert back to an Event-\>Action mind-set, rather than a Wire-Route mind-set. Old habits.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [31 October 2020 15:57 UTC](https://discourse.nodered.org/t/send-message-to-button-from-within-a-function-node/32275/4 "2020-10-31T15:57:23Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
