# Multiple inputs, multiple variables to single output ( single string)

**URL:** https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119
**Category:** General
**Created:** [1 February 2024 14:22 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119 "2024-02-01T14:22:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Pjlals](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pjlals/32/69483_2.png) [@Pjlals](https://discourse.nodered.org/u/Pjlals)
#### Post date: [1 February 2024 14:22 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/1 "2024-02-01T14:22:32Z")

</div>

hi everyone  
Pls find the flow attached below , instead of inject1 & inject 2 nodes i want to text input nodes or single ui form

[  
{  
"id": "e5aae51cd3f577c7",  
"type": "tab",  
"label": "Flow 11",  
"disabled": false,  
"info": "",  
"env":   
},  
{  
"id": "69db591dcf229454",  
"type": "group",  
"z": "e5aae51cd3f577c7",  
"style": {  
"stroke": "#999999",  
"stroke-opacity": "1",  
"fill": "none",  
"fill-opacity": "1",  
"label": true,  
"label-position": "nw",  
"color": "#a4a4a4"  
},  
"nodes": [  
"fc1f36eb4e7fd605",  
"890e368018dea777",  
"87f6971a4ab2090c",  
"5daf7c74415a6831",  
"2b09d2ec397649c5",  
"a2f2cea4f94bdf90"  
],  
"x": 4,  
"y": 79,  
"w": 922,  
"h": 202  
},  
{  
"id": "fc1f36eb4e7fd605",  
"type": "function",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "Generate Label",  
"func": "\n{\nvar variable1 = msg.payload1;\nvar variable2 = msg.payload2;\n\n msg.payload = "1=^XA^CI0 2=^FO100,25,0^BY12^BXN,7,200,20,20,1,\_^FD"+variable1+"^FS 3=^FT300,110^CI0^A0N,42,45^FD"+variable2+"^FS 4=^XZ"\n \nreturn msg;\n}\nreturn msg;\n\n",  
"outputs": 1,  
"timeout": "",  
"noerr": 0,  
"initialize": "",  
"finalize": "",  
"libs": ,  
"x": 540,  
"y": 180,  
"wires": [  
[  
"890e368018dea777"  
]  
]  
},  
{  
"id": "890e368018dea777",  
"type": "debug",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "debug 12",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "payload",  
"targetType": "msg",  
"statusVal": "",  
"statusType": "auto",  
"x": 560,  
"y": 240,  
"wires":   
},  
{  
"id": "87f6971a4ab2090c",  
"type": "comment",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "multiple variables through inject node multiple payload with join node",  
"info": "",  
"x": 660,  
"y": 120,  
"wires":   
},  
{  
"id": "5daf7c74415a6831",  
"type": "inject",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "inject1",  
"props": [  
{  
"p": "payload1",  
"v": "hello",  
"vt": "str"  
},  
{  
"p": "topic",  
"vt": "str"  
}  
],  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"topic": "",  
"x": 100,  
"y": 140,  
"wires": [  
[  
"a2f2cea4f94bdf90"  
]  
]  
},  
{  
"id": "2b09d2ec397649c5",  
"type": "inject",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "",  
"props": [  
{  
"p": "payload2",  
"v": "world",  
"vt": "str"  
},  
{  
"p": "topic",  
"vt": "str"  
}  
],  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"topic": "",  
"x": 100,  
"y": 180,  
"wires": [  
[  
"a2f2cea4f94bdf90"  
]  
]  
},  
{  
"id": "a2f2cea4f94bdf90",  
"type": "join",  
"z": "e5aae51cd3f577c7",  
"g": "69db591dcf229454",  
"name": "",  
"mode": "custom",  
"build": "string",  
"property": "payload",  
"propertyType": "msg",  
"key": "topic",  
"joiner": "\n",  
"joinerType": "str",  
"accumulate": false,  
"timeout": "10",  
"count": "2",  
"reduceRight": false,  
"reduceExp": "",  
"reduceInit": "",  
"reduceInitType": "",  
"reduceFixup": "",  
"x": 300,  
"y": 160,  
"wires": [  
[  
"fc1f36eb4e7fd605"  
]  
]  
},  
{  
"id": "76bc1abd445c98a5",  
"type": "ui\_spacer",  
"z": "e5aae51cd3f577c7",  
"name": "spacer",  
"group": "f93d8b7451631af8",  
"order": 2,  
"width": 6,  
"height": 1  
},  
{  
"id": "f93d8b7451631af8",  
"type": "ui\_group",  
"name": "Default",  
"tab": "bb1aaa5d8407907e",  
"order": 1,  
"disp": true,  
"width": "6",  
"collapse": false  
},  
{  
"id": "bb1aaa5d8407907e",  
"type": "ui\_tab",  
"name": "formentry",  
"icon": "dashboard",  
"disabled": false,  
"hidden": false  
}  
]

---

<div class="post-metadata">

### Author: ![Buckskin](https://avatars.discourse-cdn.com/v4/letter/b/b9e5f3/32.png) [@Buckskin](https://discourse.nodered.org/u/Buckskin)
#### Post date: [1 February 2024 16:41 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/2 "2024-02-01T16:41:11Z")

</div>

Hi Pjlals

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [1 February 2024 19:09 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/3 "2024-02-01T19:09:06Z")

</div>

The template node and ui-form should be all you need.  
e.g.

```auto
[{"id":"5b49c64f6c756c55","type":"ui_form","z":"e5aae51cd3f577c7","name":"","label":"","group":"2d4fe667.28f8ba","order":15,"width":0,"height":0,"options":[{"label":"var1","value":"var1","type":"text","required":true,"rows":null},{"label":"var2","value":"var2","type":"text","required":true,"rows":null}],"formValue":{"var1":"","var2":""},"payload":"","submit":"submit","cancel":"cancel","topic":"topic","topicType":"msg","splitLayout":"","className":"","x":210,"y":160,"wires":[["cd40f40eaacf5518"]]},{"id":"cd40f40eaacf5518","type":"template","z":"e5aae51cd3f577c7","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"1=^XA^CI0 2=^FO100,25,0^BY12^BXN,7,200,20,20,1,_^FD{{{payload.var1}}}^FS 3=^FT300,110^CI0^A0N,42,45^FD{{{payload.var2}}}^FS 4=^XZ","output":"str","x":380,"y":160,"wires":[["890e368018dea777"]]},{"id":"890e368018dea777","type":"debug","z":"e5aae51cd3f577c7","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":560,"y":160,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"18","collapse":false,"className":""},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

### Author: ![Pjlals](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pjlals/32/69483_2.png) [@Pjlals](https://discourse.nodered.org/u/Pjlals)
#### Post date: [2 February 2024 04:32 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/4 "2024-02-02T04:32:32Z")

</div>

@E1cid thank u somuch , its working

---

<div class="post-metadata">

### Author: ![Pjlals](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pjlals/32/69483_2.png) [@Pjlals](https://discourse.nodered.org/u/Pjlals)
#### Post date: [2 February 2024 04:34 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/5 "2024-02-02T04:34:36Z")

</div>

@Buckskin thanks for explaning how to put a code in forum , noted

---

<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: [16 February 2024 04:35 UTC](https://discourse.nodered.org/t/multiple-inputs-multiple-variables-to-single-output-single-string/85119/6 "2024-02-16T04:35:34Z")

</div>

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