# Merge/Join 2 messages

**URL:** <https://discourse.nodered.org/t/merge-join-2-messages/59840>\
**Category:** Developing Nodes\
**Created:** [14 March 2022 12:29 UTC](https://discourse.nodered.org/t/merge-join-2-messages/59840 "2022-03-14T12:29:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SplitSecComp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/splitseccomp/32/39802_2.png) [@SplitSecComp](https://discourse.nodered.org/u/SplitSecComp)\
**Post date:** [14 March 2022 12:29 UTC](https://discourse.nodered.org/t/merge-join-2-messages/59840/1 "2022-03-14T12:29:14Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b87851c97374c1f08f2c6b72b25e4d893fa43d3d.png)  
Hi.

I am trying to merge or join the 2 messages in to one but one is an object and one is a string. The join nodes does not work. How can i join merge these two messages i have tried everything but no success.

The first message is from a Termux Android GPS API and the second is from a function flow that i created.

Can anybody help me please.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 March 2022 12:55 UTC](https://discourse.nodered.org/t/merge-join-2-messages/59840/2 "2022-03-14T12:55:08Z")

</div>

You can use a csv node to convert your string into an object - it will look like this

```auto
{"col1":"probe00001",
"col2":" Mosselbaai",
"col3":" Diaz Strand",
"col4":" Drinks"}

```

You might want to use a change node to rename the elements to something more meaningful.  
Both messages need to have a msg.topic property: msg.topic = "gps", msg.topic = "event".  
Then the join node in Manual mode will combine them into one.

```auto
{
"event":{"col1":"probe00001","col2":" Mosselbaai","col3":" Diaz Strand","col4":" Drinks"},
"gps":{"latitude":-34.2,"longitude":22.1, etc}
}

```

---

<div class="post-metadata">

**Author:** ![SplitSecComp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/splitseccomp/32/39802_2.png) [@SplitSecComp](https://discourse.nodered.org/u/SplitSecComp)\
**Post date:** [14 March 2022 13:09 UTC](https://discourse.nodered.org/t/merge-join-2-messages/59840/3 "2022-03-14T13:09:18Z")

</div>

Many many thanks.....it works !!!  
I cant thank you enough i have been battling for days 😀 😀

---

<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:** [28 March 2022 13:10 UTC](https://discourse.nodered.org/t/merge-join-2-messages/59840/4 "2022-03-28T13:10:11Z")

</div>

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