I am trying to use Mule dataweave transformer to transform a JSON to an XML. One of the key name of the JSON payload is dynamic and it depends on the input you provide to the JSON payload. Please look at the line #40 where I am using
value: payload.quotes.INR.midpoint
to parse the data. INR is basically the target currency of the payload and the target currency value is line #39:
target_currency: payload.meta.effective_params.quote_currencies[0]
So while assigning the value I want to use something like this:
value: payload.quotes.($(payload.meta.effective_params.quote_currencies[0])).midpoint
Is this possible at all with Mulesoft dataweave transformer? Or, if not, then can you please suggest any neat solution?