# Weird behaviour when processing an array of arrays having null values

**URL:** <https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615>\
**Category:** Core Development\
**Created:** [19 June 2020 14:26 UTC](https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615 "2020-06-19T14:26:06Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [22 June 2020 12:22 UTC](https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615/21 "2020-06-22T12:22:03Z")

</div>

[quote="janvda, post:18, topic:28615, full:true"]

> [@Colin](#):
>
> > [@janvda](#):
> >
> > > the JSONata implementation appears to be consistent with that  
> > > [/quote]
> > > 
> > > True, but that does not mean that the implementation is performing according to the spec. An alternative implementation might convert into valid JSON first, so the result would be as you originally expected. Presumably there is a jsonata spec, but again it would need someone who knows jsonata well to understand it and see whether the implementation here is according to the spec.
> 
> I have raised following issue for that:
> 
> - [https://github.com/jsonata-js/jsonata/issues/458](https://github.com/jsonata-js/jsonata/issues/458)

I have got feedback for the issue.

**In summary:** JSONata expects JSON as input and as a `sparse array` is not proper JSON so its behaviour is undefined - which all makes sense to me.

> [@TotallyInformation](#):
>
> I would like to suggest that is a failing of the underlying library. Of course, also compounded by the other inconsistencies you've found on the JSONata/Node-RED side.

I am pretty happy with the excel node ( I was actually amazed that it worked so well). Note that returning an array of objects instead of an array of arrays would also complicate my processing (jsonata is very powerful when dealing with arrays).

For me I am happy to live with the work around =

- filling the gaps in sparse arrays by running it through 2 `json` nodes before feeding it into a change node with jsonata expressions.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 June 2020 14:04 UTC](https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615/22 "2020-06-22T14:04:24Z")

</div>

> [@janvda](#):
>
> For me I am happy to live with the work around

OK, all of this is predicated on not having too large a workbook anyway I guess. Some of the workbooks I get to handle can be hard to process in Excel itself let alone trying to manhandle (sorry, personhandle) it into node or running the data back and forth into and out of JSON 😄

That is where PowerShell is actually quite useful because of its ability to stream and pipe data more directly.

---

<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:** [21 August 2020 14:04 UTC](https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615/23 "2020-08-21T14:04:27Z")

</div>

Closed on 21 August 2020 14:04 UTC

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

[Previous page](https://discourse.nodered.org/t/weird-behaviour-when-processing-an-array-of-arrays-having-null-values/28615.md?page=1)
