Move multidimensional array data to root

We have an multidimensional array which we want to flatten to one array

'data': [
    0: [
        0: {.A.},
        1: {.B.}
    1: [
        0: {.C.},
        1: {.D.}
    2: [
        0: {.E.}

The result should be:

'result': [
    0: {.A.},
    1: {.B.},
    2: {.C.},
    3: {.D.},
    4: {.E.}

The amount of elements in arr1 can differ just as te amount of element in the sub arrays.

We tried a lot of different combinations of these transformers.
-Node, transform nodes
-Move using a pattern
-Operator Transformer (Array Merge)
-Move data between accessors

But nothing gives us the result we want, how can we get the result we want?

Hi Tim,

If the number of levels is consistent inside the array, you can use the below JMESPath syntax to achieve the expected result.


You can use it in a Value Setter, such as below.

Please give it a try.