# Array dropping bits in change node

**URL:** <https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642>\
**Category:** General\
**Created:** [3 June 2021 08:59 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642 "2021-06-03T08:59:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshuaG](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@JoshuaG](https://discourse.nodered.org/u/JoshuaG)\
**Post date:** [3 June 2021 08:59 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642/1 "2021-06-03T08:59:57Z")

</div>

I'm having an issue where I am piping 16 bits of an arrange into a change node to give them English names but for some reason the output is only keeping the first 8 bits, or 8 statements and abandoning everything else.  
Here is the flow overview:

 ![node red flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/addf95a2dfc6e0c72a079e1df474288cccbec2c5.png)  
and here is a snippit from the change node config  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/29eb108bbbfccd85134a8239c9e8bd677e5c20bd.png)

ideally this should process all 16 bits

---

<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:** [3 June 2021 09:08 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642/2 "2021-06-03T09:08:45Z")

</div>

Don't use move, use set.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [3 June 2021 09:10 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642/3 "2021-06-03T09:10:05Z")

</div>

The problem is the order you are doing the moves.

When you move payload[0] you are removing the first item of the array - so the array now has 15 elements and what was at index 1 is now at index 0. So when the next rule moves payload[1] it's actually moving what was originally payload[2] and so on.

I'd suggest changing from 'move' to 'set' to preserve the original array and then do a delete at the end.

Just be aware the set operation expects the arguments to be the other way around.

---

<div class="post-metadata">

**Author:** ![JoshuaG](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@JoshuaG](https://discourse.nodered.org/u/JoshuaG)\
**Post date:** [3 June 2021 12:36 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642/4 "2021-06-03T12:36:13Z")

</div>

Thanks,

Blockquote  
Just be aware the set operation expects the arguments to be the other way around.

> Blockquote

Was what i was sticking on, cheers.

---

<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:** [2 August 2021 12:37 UTC](https://discourse.nodered.org/t/array-dropping-bits-in-change-node/46642/5 "2021-08-02T12:37:09Z")

</div>

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