Avoid concatenation of arrays in Jsonata

Hi folks,

I started using Jsonata today, but already struggling with arrays.

This is my input:

{
   "payload": [
      {"someArray": [1,2,3]},
      {"someArray": [4,5,6]},
      {"someArray": [7,8,9]}
   ]
}

When I apply this simple Jsonata expression:

payload.someArray

Then the result is one big array:

[1,  2,  3,  4,  5,  6,  7,  8,  9]

However I would like to have an array of arrays:

[ [1,  2,  3],  [4,  5,  6],  [7,  8,  9]]

Does anybody knows how to achieve that, preferably via a "human understandable" expression :wink:

Thanks!!!
Bart

Try
payload.[someArray]

1 Like

Hey @E1cid,
That works great. Awesome. Thanks a lot!!!!
And is very short an readable...
Bart

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