Conditionally Reduce a List through a Function This DataWeave example flattens the input to something simpler. For each element in the input, it conditionally includes a contentTypes field only in case it has any values. It then rearranges this content into a more readable shape. Before you be...
For each element of the input array, in order, reduce applies the reduction lambda expression (function), then replaces the accumulator with the new result. The lambda expression can use both the current input array element and the current accumulator value. Note that if the array is empty an...