I am running Mule 3 and is on dataweave 1.0 I have a JSON payload (with dynamic key and value) which occurs inside a For Each loop. Sample data is given below:
{
"094d29c7-6abf-4acb-8513-e1d2d2b8998a": "900145600114256"
}
The key is UUID and value is an Identifier. I need to store the value in a sessionVar. Can someone help me with the dataweave 1.0 to extract the JSON value (900145600114256) from above? Thanks in advance.
I would use the pluck operator. This will go through each key value pair. In this case you would get the list of values
(payload pluck ((value,key) -> value))[0]