# How to merge object when modbus flex write is write success

**URL:** <https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264>\
**Category:** General\
**Tags:** function-node\
**Created:** [8 May 2023 07:31 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264 "2023-05-08T07:31:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanawit888](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thanawit888](https://discourse.nodered.org/u/thanawit888)\
**Post date:** [8 May 2023 07:31 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264/1 "2023-05-08T07:31:44Z")

</div>

i want to merge object when modbus flex write is write success like i write FC01 1 address , FC3 3 address when success payload is have 4 payload like

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e7e0c54dcdc0762b6be91010be1044acfff7c36a.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e7b46ed5168fa2ebf315111a67d9c6cdfcb021aa.png)

I want to merge all these payloads into one payload. Is there a way to not use join node?.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 May 2023 07:42 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264/2 "2023-05-08T07:42:06Z")

</div>

Yes, do the operations in series then after each modbus node, use a change node to move the results to a place in the msg.

---

<div class="post-metadata">

**Author:** ![thanawit888](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thanawit888](https://discourse.nodered.org/u/thanawit888)\
**Post date:** [12 May 2023 02:30 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264/3 "2023-05-12T02:30:47Z")

</div>

you have example to me?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 May 2023 08:23 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264/4 "2023-05-12T08:23:21Z")

</div>

It is very simple. Take your top function node and feed it into the write node, then after that move whatever data you want to keep into something like msg.data1. Then feed that node into the second function in your flow and into another write node. After that move the data into msg.data2, and so on. At you end you will have all you need in msg.data1, msg.data2 etc.

---

<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:** [11 July 2023 08:24 UTC](https://discourse.nodered.org/t/how-to-merge-object-when-modbus-flex-write-is-write-success/78264/5 "2023-07-11T08:24:14Z")

</div>

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