Search code examples
jsonata

How to join two arrays and join as a single nested array in jsonata


Consider if there are two arrays like

["test1"], ["test2"]

I need result as

[
  ["test1"],
  ["test2"]
]

Solution

  • In JSONata, you can use the $append function to join two arrays. However, since you want a nested array, you'll need to wrap each of your input arrays inside another array before using $append. Here's how you can achieve this:

    https://stedi.link/FH5cLbe