# Set number of message parts in Join node via msg

**URL:** <https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458>\
**Category:** General\
**Created:** [6 November 2020 15:30 UTC](https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458 "2020-11-06T15:30:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elyancorrea](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elyancorrea/32/27497_2.png) [@elyancorrea](https://discourse.nodered.org/u/elyancorrea)\
**Post date:** [6 November 2020 15:30 UTC](https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458/1 "2020-11-06T15:30:06Z")

</div>

Hello,

I need to dynamically set this property of Join node. I've a modbus node sending messages and joining them every 30 messages in an array of objects (values and addresses). How can I change this number via msg?

Is better to create a function? Anyone has an example? I've tried but has problem with for-loop.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 November 2020 15:45 UTC](https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458/2 "2020-11-06T15:45:43Z")

</div>

> If a message is received with the **msg.complete** property set, the output message is finalised and sent. This resets any part counts

so on your last message just add a msg.complete with any value

---

<div class="post-metadata">

**Author:** ![elyancorrea](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/elyancorrea/32/27497_2.png) [@elyancorrea](https://discourse.nodered.org/u/elyancorrea)\
**Post date:** [6 November 2020 16:29 UTC](https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458/3 "2020-11-06T16:29:41Z")

</div>

I'll try this solution, thankou.

---

<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:** [5 January 2021 16:29 UTC](https://discourse.nodered.org/t/set-number-of-message-parts-in-join-node-via-msg/35458/4 "2021-01-05T16:29:50Z")

</div>

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