# Split string into different flows

**URL:** <https://discourse.nodered.org/t/split-string-into-different-flows/26417>\
**Category:** General\
**Created:** [10 May 2020 11:04 UTC](https://discourse.nodered.org/t/split-string-into-different-flows/26417 "2020-05-10T11:04:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![opinionion](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@opinionion](https://discourse.nodered.org/u/opinionion)\
**Post date:** [10 May 2020 11:04 UTC](https://discourse.nodered.org/t/split-string-into-different-flows/26417/1 "2020-05-10T11:04:32Z")

</div>

Hello everyone.  
Is there a way to split msg.payload string into three diffrent flows.  
The input is a message (from twitter) that i need to split into three diffrent flows. The payload has to be cut afer 100 characters, i was already able to do that with the split node but how can i direct the messages to diffrent flows

 ![öadsfölkajsdöflkjaösdlkjfaölksdjf](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/28992ada7fb013e683951ae35a7159002a489436.png) Like you can see on the picture this is what i would like, but i am not able to achive

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 May 2020 11:34 UTC](https://discourse.nodered.org/t/split-string-into-different-flows/26417/2 "2020-05-10T11:34:31Z")

</div>

well you could do it many ways and here are two:

Use a `split` node followed by a `switch` which checks msg.parts.index - have three tests and you get your three outputs. (see [https://nodered.org/docs/user-guide/messages#understanding-msgparts](https://nodered.org/docs/user-guide/messages#understanding-msgparts))

Use a `function` node to breakup the data and form three msgs and send them out on three outputs to determine, See [https://nodered.org/docs/user-guide/writing-functions#multiple-messages](https://nodered.org/docs/user-guide/writing-functions#multiple-messages)

---

<div class="post-metadata">

**Author:** ![opinionion](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@opinionion](https://discourse.nodered.org/u/opinionion)\
**Post date:** [10 May 2020 14:08 UTC](https://discourse.nodered.org/t/split-string-into-different-flows/26417/3 "2020-05-10T14:08:03Z")

</div>

Thank you very much i totaly forgot that the switch node can have mulitiple outpus. It still was a bit more complicated i uses some converter to get the string into an object to finally add an index so i can sort the messages in the right order.  
Have a nice day.

---

<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:** [24 May 2020 14:08 UTC](https://discourse.nodered.org/t/split-string-into-different-flows/26417/4 "2020-05-24T14:08:15Z")

</div>

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