Convert JSON Array returned from REST GET into usable variable for data view objects

0
I intend to add a weather forecast functionality to my app in mendix. I have already completed the Call REST(GET) for the API, and properly return the info needed. However, one of the objects is returned as an [Array] via the JSON from the REST (GET). For reference, this array contains the current weather condition (raining, sunny, rainlight, etc). Here is a small snippet from their website. { "coord": { "lon": -122.08, "lat": 37.39 }, "weather": [ { "id": 800, "main": "Clear", "description": "clear sky", "icon": "01d" } ], "base": "stations", "main": { "temp": 282.55, "feels_like": 281.86, "temp_min": 280.37, "temp_max": 284.26, "pressure": 1023, "humidity": 100 },   Really all i need to do is take the array (or list as the microflows calls it) and extract 2 of the 4 variable-value pairs into their own object so i can use the info in Data Views. Ultimatley im trying to use the “main” string and its “description” string from the array to dynamically affect a weather overlay on top of a map. its been 6 hours of googling and finding no solutions, only one short forum post on here that was close, but it didnt contain any relevant info to do this from scratch.
asked
1 answers
1

HI Brendin Todd,
 You can create a import mapping and select the object which are necessary for you. The in the import mapping settings you use set association option, which will create the association in the runtime while creating objects .

In your Microflow write your own custom logic to retrieve the array and map, store it. 

 

  1. The example json which is in the question doesn’t seem like a valid one. Can you provide a valid json, I can create sample microflow and paste it here for you reference.
answered