# Change Object to an Array

**URL:** <https://discourse.nodered.org/t/change-object-to-an-array/63211>\
**Category:** General\
**Created:** [29 May 2022 13:05 UTC](https://discourse.nodered.org/t/change-object-to-an-array/63211 "2022-05-29T13:05:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zyan](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@Zyan](https://discourse.nodered.org/u/Zyan)\
**Post date:** [29 May 2022 13:05 UTC](https://discourse.nodered.org/t/change-object-to-an-array/63211/1 "2022-05-29T13:05:19Z")

</div>

Hi i try to get the Yellow marked "x y" changed, that it comes out like in the Blue Circle.

So that x gets 0 and y gets 1

Thx in advance.

![xy](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/035970eb340405dde21b14db9e6399f595e991da.png)

---

<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:** [29 May 2022 13:22 UTC](https://discourse.nodered.org/t/change-object-to-an-array/63211/2 "2022-05-29T13:22:33Z")

</div>

function node...

```javascript
msg.payload = [msg.payload.xy_color.x, msg.payload.xy_color.y];
return msg;

```

Just as simple with a change node too

---

<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:** [12 June 2022 13:22 UTC](https://discourse.nodered.org/t/change-object-to-an-array/63211/3 "2022-06-12T13:22:53Z")

</div>

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