# Naming msg.payload after join node

**URL:** <https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621>\
**Category:** General\
**Created:** [22 April 2022 01:27 UTC](https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621 "2022-04-22T01:27:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nightmareside15](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nightmareside15/32/56176_2.png) [@nightmareside15](https://discourse.nodered.org/u/nightmareside15)\
**Post date:** [22 April 2022 01:27 UTC](https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621/1 "2022-04-22T01:27:26Z")

</div>

![tanyaForum](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/33e3b0b23e07ebf9c5375624f67ed66064031555.png)

Hello. Is there anything I can do to change the object name after passing the join node? I notice sometimes the output will changing and this might became a problem If i were to add some function dedicated to that object. Any help would be appreciated! Thanks!

```auto
[
    {
        "id": "9c5a65d43c1c7876",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "6b910709349bc7f2",
        "type": "inject",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "topic1",
        "payload": "1",
        "payloadType": "str",
        "x": 130,
        "y": 40,
        "wires": [
            [
                "d70c23422362c6b6"
            ]
        ]
    },
    {
        "id": "a2a2c0a31faf29c0",
        "type": "inject",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "topic2",
        "payload": "2",
        "payloadType": "str",
        "x": 130,
        "y": 120,
        "wires": [
            [
                "d70c23422362c6b6"
            ]
        ]
    },
    {
        "id": "d70c23422362c6b6",
        "type": "join",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": true,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 310,
        "y": 80,
        "wires": [
            [
                "a80e79598b25f83b"
            ]
        ]
    },
    {
        "id": "a80e79598b25f83b",
        "type": "join",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "mode": "custom",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 490,
        "y": 140,
        "wires": [
            [
                "eb0577b6dd1671f7"
            ]
        ]
    },
    {
        "id": "aa17049f4ddb1257",
        "type": "inject",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "topic3",
        "payload": "3",
        "payloadType": "str",
        "x": 270,
        "y": 200,
        "wires": [
            [
                "a80e79598b25f83b"
            ]
        ]
    },
    {
        "id": "eb0577b6dd1671f7",
        "type": "debug",
        "z": "9c5a65d43c1c7876",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 710,
        "y": 120,
        "wires": []
    }
]

```

---

<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:** [22 April 2022 07:17 UTC](https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621/2 "2022-04-22T07:17:06Z")

</div>

After the first join node set the msg.topic to what you want, as it will change depending on the order topic1 & 2 arrive.  
e.g.

```auto
[{"id":"6b910709349bc7f2","type":"inject","z":"9c5a65d43c1c7876","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic1","payload":"1","payloadType":"str","x":130,"y":40,"wires":[["d70c23422362c6b6"]]},{"id":"d70c23422362c6b6","type":"join","z":"9c5a65d43c1c7876","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":310,"y":80,"wires":[["eb0577b6dd1671f7","4f3828b8.e66108"]]},{"id":"a2a2c0a31faf29c0","type":"inject","z":"9c5a65d43c1c7876","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic2","payload":"2","payloadType":"str","x":130,"y":120,"wires":[["d70c23422362c6b6"]]},{"id":"eb0577b6dd1671f7","type":"debug","z":"9c5a65d43c1c7876","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":120,"wires":[]},{"id":"4f3828b8.e66108","type":"change","z":"9c5a65d43c1c7876","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":120,"wires":[["a80e79598b25f83b"]]},{"id":"a80e79598b25f83b","type":"join","z":"9c5a65d43c1c7876","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":510,"y":160,"wires":[["eb0577b6dd1671f7"]]},{"id":"aa17049f4ddb1257","type":"inject","z":"9c5a65d43c1c7876","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic3","payload":"3","payloadType":"str","x":270,"y":200,"wires":[["a80e79598b25f83b"]]}]

```

---

<div class="post-metadata">

**Author:** ![nightmareside15](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nightmareside15/32/56176_2.png) [@nightmareside15](https://discourse.nodered.org/u/nightmareside15)\
**Post date:** [22 April 2022 08:23 UTC](https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621/3 "2022-04-22T08:23:06Z")

</div>

Anddd..done! Thank you very much. It is so simple and yet I can't figured it out lol

---

<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:** [6 May 2022 08:23 UTC](https://discourse.nodered.org/t/naming-msg-payload-after-join-node/61621/4 "2022-05-06T08:23:41Z")

</div>

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