# JSONata and arrays in root of msg

**URL:** https://discourse.nodered.org/t/jsonata-and-arrays-in-root-of-msg/17937
**Category:** General
**Created:** [14 November 2019 09:44 UTC](https://discourse.nodered.org/t/jsonata-and-arrays-in-root-of-msg/17937 "2019-11-14T09:44:03Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)
#### Post date: [17 November 2019 01:49 UTC](https://discourse.nodered.org/t/jsonata-and-arrays-in-root-of-msg/17937/11 "2019-11-17T01:49:12Z")

</div>

> [@knolleary](#):
>
> If there's a node sending a message like that, then that is completely wrong and the node must be fixed.

Based on your code in the function node, the exact thing Nick described is happening. The message is not an object but an array. If the node was okay, your code should at least have had to interact with `msg.payload[t]` rather than with msg directly. Seeing that it is not, this suggest a huge design mistake in the node you are using.

However, the Nordpool node should return a msg.payload that is an array according to this line so I’ve no clue at all what is happening here

> <https://github.com/Ell-i/node-red-contrib-nordpool/blob/ee4f9000c4a93ee30f4c1d929b2693e6b1e08ec0/src/nordpool.js#L69>

---

_[View the full topic](https://discourse.nodered.org/t/jsonata-and-arrays-in-root-of-msg/17937)._
