Satheesh Kumar Satheesh Kumar - 4 years ago 132
JSON Question

how to merge two Json based on key value in Mule

Hi I have a 1 json as below

"first": [
{
"projectid": "15",
"approval_status": "A"
},
{
"projectid": "24",
"approval_status": "A"
} ]}


The next payload is stores in a flowVariable

{
"Second": [
{
"projectid": "15",
"total": "123",
"updated": "yes"
},
{
"projectid": "24",
"total": "123",
"updated": "yes"
}]}


Am using datawevae to merge these payload but its not giving expected result my expected value is

{
"Result": [
{
"projectid": "15",
"total": "123",
"approval_status": "A"
},
{
"projectid": "24",
"total": "123",
"approval_status": "A"
}]}

Answer Source

I have clearly mentioned how to do it in this article

Dzone article about Merging payload using DataWeave

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download