# Noob question for array to get avalue

**URL:** <https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881>\
**Category:** General\
**Tags:** split\
**Created:** [18 August 2021 15:12 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881 "2021-08-18T15:12:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MHagreis](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mhagreis/32/46673_2.png) [@MHagreis](https://discourse.nodered.org/u/MHagreis)\
**Post date:** [18 August 2021 15:12 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881/1 "2021-08-18T15:12:32Z")

</div>

i like to get from this the yellow fields the value into a new node  
how do i split this into separate values via json?

how do i do that i missing some json understanding

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/8/68f6d587986214aafba015a0d780b7f0809074d3.png)

---

<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:** [18 August 2021 15:21 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881/2 "2021-08-18T15:21:46Z")

</div>

Hi @MHagreis

this section of the docs describes how you can identify the path to any element of a message - [Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)

Using what those docs say, you'll find you can access some of your highlighted properties as `msg.payload[0][0].subsystem` and `msg.payload[0][0].num_user` for the first two, and `msg.payload[0][3].subsystem` and `msg.payload[0][3].num_user` for the second two.

What you do from there will depend on how you want to use those values.

---

<div class="post-metadata">

**Author:** ![MHagreis](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mhagreis/32/46673_2.png) [@MHagreis](https://discourse.nodered.org/u/MHagreis)\
**Post date:** [19 August 2021 09:48 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881/3 "2021-08-19T09:48:39Z")

</div>

> [@knolleary](#):
>
> `msg.payload[0][0].subsystem` and `msg.payload[0][0].num_user` for the first two, and `msg.payload[0][3].subsystem` and `msg.payload[0][3].num_user` for the second two.

Thanks solved and now i am getting the logic as wel 😄 (a bit less noob)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [19 August 2021 16:28 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881/4 "2021-08-19T16:28:54Z")

</div>

There is another way to extract bits from a JSON object structure, using the JSONata expression syntax of the `change` node. Just as a teaser, here is an expression that retrieves just those 2 fields from an array of objects:

```auto
payload.*.{
    "subsystem": subsystem,
    "num_user": num_user
}

```

Head over to [try.jsonata.org](https://try.jsonata.org) for more info -- and to experiment with your own data.

---

<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:** [18 October 2021 16:29 UTC](https://discourse.nodered.org/t/noob-question-for-array-to-get-avalue/49881/5 "2021-10-18T16:29:32Z")

</div>

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