Search code examples
mulemulesoftmule-esb

Access property json in variable (flowVars) Mulesoft


i have a problem like this: I saved my request Json to Variable and now i want to access property in Json throught Variable. How can i do this ? #[flowVars.x.id] or #[flowVars.x/id] not working. And i using open source so i can't use datawave too.


Solution

  • Convert to a Java object before assigning to the flowVar:

    <json:json-to-object-transformer doc:name="JSON to Object" returnClass="java.lang.Object"/>
    

    Then you can access the attributes by name.