Reputation: 78
Exisiting Json { a:1, b:2 }
Add the field c:3
Final Output expected { a:1, b:2, c:3 }
Upvotes: 2
Views: 3066
Reputation: 41
You can directly keep payload as it is and add the new JSON field as below:
payload ++ {c:3}
output:
{
a:1,
b:2,
c:3
}
Upvotes: 1
Reputation: 290
%dw 2.0
output application/json
---
{ a:1, b:2 } ++ {c: 3}
Sample Output:
{
"a": 1,
"b": 2,
"c": 3
}
Upvotes: 2