# Pass Input to Output after Pressing Click Button

**URL:** https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458
**Category:** Dashboard
**Created:** [28 September 2020 16:29 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458 "2020-09-28T16:29:05Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 19:10 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/22 "2020-09-29T19:10:13Z")

</div>

I read your topic 2 times. Does this means output will be generated only when all the inputs received. Means I will add button and send string pass from button then only joint node will pass value. Is my understanding correct?

---

<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: [29 September 2020 19:20 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/23 "2020-09-29T19:20:42Z")

</div>

Feed the set data message and the button into the Join node. Make sure they have different topics.  
Set the Join node to 2 message parts and After Every Subsequent Message.  
Look at the debug messages you get out.  
Then add a Switch node set to only pass messages with the button topic.

If you need to post a flow here then just export the important nodes, we don't need to see all the stuff before the set data node, and paste it here using the `</>` button at the top of the forum text input window when pasting it in.

---

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 19:35 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/24 "2020-09-29T19:35:16Z")

</div>

Now event is occuring after button click but i am getting output as follows:

9/30/2020, 1:03:34 AM[node: b2a0eeb6.1a09f](http://127.0.0.1:1880/#)pass : msg.payload : Object  
object  
setdata: "53225850.c42b88"  
pass: "Pass"

i am not getting set data properly. This output is of joint node.

What should i do next?

---

<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: [29 September 2020 19:40 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/25 "2020-09-29T19:40:52Z")

</div>

What are you getting out of the setdata node?

---

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 19:43 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/26 "2020-09-29T19:43:44Z")

</div>

i am getting object only but as it is function i am not able to set topic to it. What should i do in such case?

---

<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: [29 September 2020 19:46 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/27 "2020-09-29T19:46:59Z")

</div>

I don't understand. You can set the topic in a function node.  
Is the right value coming out of the setdata node?  
Are you getting the right data out of the set data node? If so feed it into a debug node and show me.

---

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 19:49 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/28 "2020-09-29T19:49:31Z")

</div>

9/30/2020, 1:18:08 AM[node: msg.payload](http://127.0.0.1:1880/#)msg.payload : Object

{ Timestamp: 1601408888597, Voltage: 242.8500061, Current: 0, Power Factor: 1.0019378662109375, Frequency: 50.064727783203125 … }

Above is the output of set data node. Can you guide me how to set topic to function?

---

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 19:55 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/29 "2020-09-29T19:55:12Z")

</div>

Thanks Colin, now i am receiving correct data. i have set the topic n the function. now i want to separate the set data payload and button pass payload. How can i do that?

---

<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: [29 September 2020 20:08 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/30 "2020-09-29T20:08:23Z")

</div>

Use a Change node to Move the property you want to the payload.

---

<div class="post-metadata">

### Author: ![Chetan\_001](https://avatars.discourse-cdn.com/v4/letter/c/eb8c5e/32.png) [@Chetan\_001](https://discourse.nodered.org/u/Chetan_001)
#### Post date: [29 September 2020 20:33 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/31 "2020-09-29T20:33:00Z")

</div>

Thanks Colin your guidance was really supportive.

Now Can you guide me about integrating bar code scanner machine to node red?

---

<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: [29 September 2020 20:47 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/32 "2020-09-29T20:47:46Z")

</div>

Best to start a new thread if you have a new question.

---

<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: [13 October 2020 20:47 UTC](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458/33 "2020-10-13T20:47:50Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/pass-input-to-output-after-pressing-click-button/33458.md?page=1)
