Input
[ { "id" : "11111", "name" : "AAAAA" }, { "id" : "22222", "name": "BBBBB" }, { "id" : "33333", "name" : "CCCCC" } ]
Output
["11111", "22222", "33333"]As you can see, we only want to extract the id from the input.
DataWeave Script
%dw 1.0 %output application/java --- payload map (data) -> data.idThe map function from the Dataweave component is the mostly used function. Here we using a simple lamda expression to extract id. Another simple way is:
payload map $.id
Very informative post for mulesoft developers.You can also visit goformule.com for mulesoft stuff.
ReplyDelete