You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We often have the need to flatten an array of arrays. However, there are cases where it is necessary to convert an array of multi-level arrays, but DataWeave does not have an out-of-the-box function for this, nor an easy solution that solves the scenarios where the sub-levels are composed with Array and Range. And besides, I miss setting the flattening level in the sublevels.
So we thought and created a function to facilitate our planning with these features and improvements. The name of this function is flattenDeep containing two input parameters, the 1st parameter being the array of elements and the 2nd parameter the flattening level. Here is the example of the function:
We often have the need to flatten an array of arrays. However, there are cases where it is necessary to convert an array of multi-level arrays, but DataWeave does not have an out-of-the-box function for this, nor an easy solution that solves the scenarios where the sub-levels are composed with Array and Range. And besides, I miss setting the flattening level in the sublevels.
So we thought and created a function to facilitate our planning with these features and improvements. The name of this function is flattenDeep containing two input parameters, the 1st parameter being the array of elements and the 2nd parameter the flattening level. Here is the example of the function:
Expected Output:
The text was updated successfully, but these errors were encountered: