I'm trying to map a column name dynamically in Dataweave using the contents of a flow variable. The static version of what I'm trying to achieve looks something like:
payload map ((payload01 , indexOfPayload01) -> {
COLUMNA: payload01.INPUTA
})
Now the part that I need to be dynamic is INPUTA
- I need the A
to be derived from a flow variable that is set prior to the Dataweave component. I've tried something like:
payload map ((payload01 , indexOfPayload01) -> {
COLUMNA: payload01.INPUT#flowVars['varName']
})
But I'm getting a com.mulesoft.weave.grammar.InvalidNamespacePrefixException
error.
Is this possible to achieve in Dataweave? Can't seem to find any relevant docs describing how.