# Data segregation and display in different ui text

**URL:** <https://discourse.nodered.org/t/data-segregation-and-display-in-different-ui-text/20847>\
**Category:** General\
**Created:** [25 January 2020 19:11 UTC](https://discourse.nodered.org/t/data-segregation-and-display-in-different-ui-text/20847 "2020-01-25T19:11:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allappamp](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Allappamp](https://discourse.nodered.org/u/Allappamp)\
**Post date:** [25 January 2020 19:11 UTC](https://discourse.nodered.org/t/data-segregation-and-display-in-different-ui-text/20847/1 "2020-01-25T19:11:38Z")

</div>

Hello,

I have one problem please help me to solve that  
i have a serial data ex: "Device ID | Device Data" "1|232" and "2|232" and "3|232"  
i want to segregate data and place the data into separate ui text outputs.  
if device ID=1 Data should store in Text1  
if device ID=2 Data should store in Text2

please help me to solve this

---

<div class="post-metadata">

**Author:** ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)\
**Post date:** [25 January 2020 19:36 UTC](https://discourse.nodered.org/t/data-segregation-and-display-in-different-ui-text/20847/2 "2020-01-25T19:36:44Z")

</div>

I would use a function node splitting your incoming string into two parts using `sting.split(“|”)` Take a look here somebody had a similar problem:

> [@Separate time stamp and payload from string](https://discourse.nodered.org/t/separate-time-stamp-and-payload-from-string/20425/2):
>
> Welcome! Your device is sending not so “well” formatted messages but never mind. You can use a function node using the string.split() function and take your string appart: var parts=msg.payload.split(“:”); msg.timeString=parts[0]+”:”+parts[1]+”:”+parts [2]; msg.payload=Number(parts[3]); msg.timestamp= new Date(); msg.timestamp=msg.timestamp.setHours(Number(parts[0]), Number(parts[1]), Number(parts[2])).valueOf(); return msg; Code not tested just typed in on my phone but give it a try.
