# Split Payload object, Fixed length of 1 Array not working

**URL:** <https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669>\
**Category:** General\
**Created:** [15 March 2021 14:11 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669 "2021-03-15T14:11:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomstud](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tomstud](https://discourse.nodered.org/u/tomstud)\
**Post date:** [15 March 2021 14:11 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/1 "2021-03-15T14:11:21Z")

</div>

Hey Guys,

I'm using a split node which gets injected with an array with 3 objects in the array. When I try to use the split node to split the array into an individual array so 1 object. I set the Fixed length of 1 on the Array settings for the split and when the payload goes through it i just get "[object Object]" 3 times.

But when I set the Fixed length of 2 on the split node for the array settings it works but it splits out array of size 2 and then arrat of size 1. As you can see in the pictures.

How can i get the split to work to split into 1 since it works for 2 or 3 but not 1 for some reason?

 ![array 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/c/3c8f3458ea40116e79f2d44509b5e7a8462f4a1d.jpeg) ![array 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5f7353f7d90b7467742e84c53e5537907ee3b87c.jpeg)

---

<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:** [15 March 2021 14:29 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/2 "2021-03-15T14:29:00Z")

</div>

Can you add another debug node showing what is going into the split node, give the debug nodes names so they can be identified in the output and run it again with it set to length of 1 please.

Also tell us which OS you are running and which versions of node-red and nodejs you are running.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [15 March 2021 14:50 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/3 "2021-03-15T14:50:06Z")

</div>

If you are using the node-red-node-mysql, ckeck the version number and make sure it is v0.1.2 or greater. There was an issue about the format of objects being returned which was fixed in v0.1.2

---

<div class="post-metadata">

**Author:** ![tomstud](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tomstud](https://discourse.nodered.org/u/tomstud)\
**Post date:** [15 March 2021 15:05 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/4 "2021-03-15T15:05:27Z")

</div>

I've attached teh before debug node as you can see called before split and then debug node after split and you can see an array with 3 objects is passed into it and then "[object Object]" is outputted if the length is set to 1 but if it's set to 2 then it outputs the object normally just 2 objects in first array and then 1 in the first.

I have node red on Raspberry Pi 4 raspbian my node-red version is v1.2.9 and nodejs v12.21.0

 ![array 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a5760a8c6692a84f00b1c5f8fb8a66ddea6ca6b.jpeg) ![array 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/92dbfca3a4321b79955057b2b0ac4216e465ec01.jpeg)

---

<div class="post-metadata">

**Author:** ![tomstud](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tomstud](https://discourse.nodered.org/u/tomstud)\
**Post date:** [15 March 2021 15:07 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/5 "2021-03-15T15:07:44Z")

</div>

Thank you so much. Yes that was the issue i was on 0.1.1 updated to 0.1.4

---

<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:** [29 March 2021 15:07 UTC](https://discourse.nodered.org/t/split-payload-object-fixed-length-of-1-array-not-working/42669/6 "2021-03-29T15:07:46Z")

</div>

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