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"
}]}
I am not sure how are you getting both the payloads at the same time
But if you are able to get both the payload and able to save into 2 flow variables, then you can use an Expression transformer to construct your combined payload.
Below is a sample you can try to combine both the payload dynamically:-
Please note, the above example is just to show how you can combine the payload dynamically and quickly.
Here you need to store both the payload in a flow variable var1 and var2, (
I have used set payload just to demonstrate, you need to get it dynamically
) , then you can construct the payload dynamically using the expression transformerAlso note, if you are getting the json payload in the exact same structure, you can use the above code for a quick combination of payloads...
But, if your json structure changes say one more list element included in your payload, then you need to modify the above code and use a for loop to get the values.
The above code will produce a quick combined payload as follows:-