Hi Shreyash,
Mendix cannot handle these "dynamic" attributes, where in one instance it is a decimal value and in the next its an array of objects.
The JSON document in Mendix will show a warning when you input this JSON string, that it will only look at the first element of a given JSON string (in this case it will map the value to an integer attribute).
If you want this data imported you can map the fields that are always of the same type and the fields / objects that are not static you can map through microflow actions, e.g. use JSON Path module to load the values for these instances or use other marketplace modules aimed at mapping dynamic JSON documents.
Another approach would be to first modify the JSON into a document that has a fixed structure.
Edit 202409101117:
- You need to store the http content in the httpRequest (or string) so you can use that string for futher processing (the Import mapping & JSON paths)
- Apply additional mappings per scenario. In this example I store the result on an attribute (e.g. write a section of the JSON into an attribute and depending on the type you can add additional import mappings specific for that section)
- Use https://jsonpath.com/ to check what json paths you need
With kind regards,
Stephan