# JOIN two strings into one string

**URL:** <https://discourse.nodered.org/t/join-two-strings-into-one-string/38423>\
**Category:** General\
**Created:** [2 January 2021 21:28 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423 "2021-01-02T21:28:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarmoboy](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jarmoboy](https://discourse.nodered.org/u/jarmoboy)\
**Post date:** [2 January 2021 21:28 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423/1 "2021-01-02T21:28:26Z")

</div>

Hi, Iam trying to send url command to differnet ip. Command is always the same but IP differs. I have about 45 IP. So i dont want to have 45 injects to set ON and 45 to set OFF. My idea was "a list of IP" + command = sends a result.  
I tried with manual JOIN node and string, but the order of messages isnt always right. msg.parts.id isnt working (but i assume i understand it wrong). Does anyone has an idea how to make it?

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [2 January 2021 21:44 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423/2 "2021-01-02T21:44:58Z")

</div>

Hi,

maybe you can create an array of your IPs and loop throught them in a Function node ?  
possibly also use a Delay node to Rate limit the commands if you have to.

Not sure if its what you are looking for but here's an example :

```auto
[{"id":"87b9c2b4.326cb","type":"inject","z":"794b81b0.83a06","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":310,"y":380,"wires":[["49470cbb.c05dd4"]]},{"id":"49470cbb.c05dd4","type":"function","z":"794b81b0.83a06","name":"","func":"let ips = [\n'192.68.1.0',\n'192.68.1.1',\n'192.68.1.2',\n'192.68.1.3',\n'192.68.1.4',\n'192.68.1.5',\n'192.68.1.6',\n'192.68.1.7',\n'192.68.1.8',\n'192.68.1.9',\n'192.68.1.10',\n'192.68.1.11',\n'192.68.1.12',\n'192.68.1.13',\n'192.68.1.14',\n'192.68.1.15']\n\nips.forEach( ip => {\n \n node.send({payload: `Command to ${ip}`})\n \n})\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":510,"y":380,"wires":[["b9de523a.0b57d"]]},{"id":"c9849f5e.a65238","type":"debug","z":"794b81b0.83a06","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":870,"y":380,"wires":[]},{"id":"b9de523a.0b57d","type":"delay","z":"794b81b0.83a06","name":"","pauseType":"rate","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"3","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":700,"y":380,"wires":[["c9849f5e.a65238"]]}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 January 2021 09:52 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423/3 "2021-01-03T09:52:29Z")

</div>

What is/platforms are they on ? Linux has a command dsh ( for distributed shel) that provides exactly that capability.

---

<div class="post-metadata">

**Author:** ![jarmoboy](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@jarmoboy](https://discourse.nodered.org/u/jarmoboy)\
**Post date:** [3 January 2021 10:29 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423/4 "2021-01-03T10:29:48Z")

</div>

works great, thats what i wanted

---

<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:** [4 March 2021 10:29 UTC](https://discourse.nodered.org/t/join-two-strings-into-one-string/38423/5 "2021-03-04T10:29:56Z")

</div>

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