Reputation: 526
I am trying to set up the key value for json from the flowVar. Its not working in dataweave 2.0. I might be missing something (syntax). I have a variable test with value. Dataweave code looks like below.
%dw 2.0
output application/json
---
{
vars.test: "hi"
}
Upvotes: 0
Views: 90
Reputation: 25837
You need to use parenthesis around the key if it is dynamic:
%dw 2.0
output application/json
---
{
(vars.test): "hi"
}
Upvotes: 3