Make it possible to map parts of an XML or JSON as a string - Mendix Forum

Make it possible to map parts of an XML or JSON as a string

7

In some situations you would like to have more flexibility in import mappings. When you would be able to handle a subpart of your XML or JSON as a string you would be a lot more flexible.

We have a (simplified) JSON snippet below. Mapping this with a Mendix import mapping is not possible because the value parameter is a string in one operation and an array in the other. It would be great if we could use an import mapping for the operation objects and store the JSON content below as a string. So you would get 2 Operations Mendix objects with one string attribute that would contain the JSON contents of each operation object. When we have that we can use some MF logic to split the operations and use specific import mappings for the different operation structures.

I hope the explanation is a bit clear :).

{
    "ID": "213123"
    "Ops": [{
        "operation": "Replace",
        "path": "displayName",
        "value": "xxxxx"
    },
    {
        "operation": "Replace",
        "path": "displayName",
        "value": [{
            "value": "123123",
            "2ndvalue": "weflkcjewrioe"
        }]
    }]
}

 

asked
0 answers