0

Input:-

[
  {
    "appName": "helloworld-1"
  },
  {
    "appName": "helloworld-2"
  }
]

Expected Output

{
"appList": [ "helloworld-1" , "helloworld-2" ]
}

Can anyone guide me for data weave script for this ?

1 Answers1

0

According to the DataWeave Documentation, you can apply the multi value selector. Multi value selector returns an array with all the values whose key matches the expression.

%dw 1.0
%output application/json
---
{
    appList : payload.*appName
}