# Splitting a array payload to peform an action for each object

**URL:** <https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796>\
**Category:** General\
**Created:** [28 November 2025 14:18 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796 "2025-11-28T14:18:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimbo84](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jimbo84](https://discourse.nodered.org/u/Jimbo84)\
**Post date:** [28 November 2025 14:18 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/1 "2025-11-28T14:18:37Z")

</div>

I'm very new to nodered so please bear with me. I'm using it as part of a workflow solution. I've got the below payload from a node and want to perform an action for each item.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/536baa12eec81ff7bfeaf0d5dc8d2943763aaee9.png)

I need to update a database as such to add the pages shown above for each dataRecordID if that makes sense

---

<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:** [28 November 2025 14:45 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/2 "2025-11-28T14:45:14Z")

</div>

Welcome to the forum @Jimbo84

If you feed that through a Split node it will send a message for each item in the array.

---

<div class="post-metadata">

**Author:** ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)\
**Post date:** [28 November 2025 15:09 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/3 "2025-11-28T15:09:52Z")

</div>

something like this where you first split the array, perform some action on the individual values and them combine the results together again using the join node:

```flows
[
    {
        "id": "d879ea9457ecd1cd",
        "type": "inject",
        "z": "f93e13e54f881a08",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[1,2,3,4,5,6,7,8,9,10]",
        "payloadType": "json",
        "x": 803,
        "y": 159,
        "wires": [
            [
                "01253df4a5f32a0e"
            ]
        ]
    },
    {
        "id": "01253df4a5f32a0e",
        "type": "split",
        "z": "f93e13e54f881a08",
        "name": "",
        "splt": "\\n",
        "spltType": "str",
        "arraySplt": 1,
        "arraySpltType": "len",
        "stream": false,
        "addname": "",
        "property": "payload",
        "x": 1000,
        "y": 264,
        "wires": [
            [
                "36789140a11b2108"
            ]
        ]
    },
    {
        "id": "36789140a11b2108",
        "type": "function",
        "z": "f93e13e54f881a08",
        "name": "function 1",
        "func": "msg.payload += 1;\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1174,
        "y": 150,
        "wires": [
            [
                "01cacb262a23a5c1"
            ]
        ]
    },
    {
        "id": "01cacb262a23a5c1",
        "type": "join",
        "z": "f93e13e54f881a08",
        "name": "",
        "mode": "auto",
        "build": "object",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "useparts": false,
        "accumulate": "false",
        "timeout": "",
        "count": "",
        "reduceRight": false,
        "x": 1362,
        "y": 267,
        "wires": [
            [
                "8ff1dff43deaa2b6"
            ]
        ]
    },
    {
        "id": "8ff1dff43deaa2b6",
        "type": "debug",
        "z": "f93e13e54f881a08",
        "name": "debug 118",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1664,
        "y": 267,
        "wires": []
    }
]

```

it all looks like there is only one message flowing but you have imagine the link after the split as being a bunch of links all executing in parallel.

---

<div class="post-metadata">

**Author:** ![Jimbo84](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jimbo84](https://discourse.nodered.org/u/Jimbo84)\
**Post date:** [1 December 2025 08:49 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/4 "2025-12-01T08:49:10Z")

</div>

What do I need to split by though as if I use /n isn't not splitting it down so I can access counts\>pages

---

<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:** [1 December 2025 09:10 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/5 "2025-12-01T09:10:19Z")

</div>

If it is an array it will split into individual elements of the array.

---

<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:** [1 December 2025 09:30 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/6 "2025-12-01T09:30:19Z")

</div>

If it is not splitting then add a debug node showing what is going into the split node, and another showing what is coming out. Leave the split node at its default settings.

---

<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:** [1 March 2026 09:31 UTC](https://discourse.nodered.org/t/splitting-a-array-payload-to-peform-an-action-for-each-object/99796/7 "2026-03-01T09:31:12Z")

</div>

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