Free MuleSoft CONNECT Keynote & Expo Pass Available!

Register now+
Nav

flatten

flatten(Array<Array<T> | Q>): Array<T | Q>

If you have an array of arrays, this operator can flatten it into a single simple array.

Transform

        
     
1
2
3
4
%dw 2.0
output application/json
---
flatten(payload)
Input

        
     
1
2
3
4
5
[
   [3,5],
   [9,5],
   [154,0.3]
]
Output

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