Reduce Function - MuleSoft Dataweave Functions
Reduce Function - MuleSoft Dataweave Functions
REDUCE FUNCTION
or
Here
Dataweave:
%dw 2.0
output application/json
---
[2, 3] reduce ($ + $$)
Here
So result will be 5
Dataweave:
%dw 2.0
output application/json
---
[2,3] reduce ((item, acc = 4) -> acc +
item)
Here
So result will be 9
more details
Share this:
Li C O T W S
n o u w h h
! Subscribe !
{} [+] %
3 COMMENTS
" # Oldest $
Hello Admin,
while concatenating using reduce function
getting the output as “54321”
—-
if acc value is not initialized
acc -> $$ will take the 1st item value
$ will take the 2nd item value
4 Reply
I/P
a = [1,2,3,4,5,6]
b = [3,4,5,6]
O/P
C = [3,4,5,6]
9 Reply '
# Reply to suzi
1 Reply
Topic !
TRANSLATE
English
TOPICS
RECENT POSTS
POPULAR POSTS
If Else In Dataweave
POPULAR TAGS
LINKS
Contributory
Suggestions
Email us – [email protected]