Import mapping and JSON

0
Hello, I’ve follow the tutorial consume REST with Mendix with JSON.  https://www.youtube.com/watch?v=OhzWTa1kZ00&feature=emb_title But i cannot get my data and I don’t know why. This is my data : I just want : result.[0].Humidity , result.[0].LastUpdate and result.[0].Temp So I’ve create a JSON structure, and import mapping en generate model : I get the JSON with a rest GET, on the url I can change the ID of my device, that’s why I’ve set an input. And my page is : The CreatInput microflow is the same as the mendix tutorial. But nothing append. What I do wrong ?
asked
4 answers
3

At first sight, it looks like there is no association defined on your mapping between input and jsonObject. If this is not set, you will not be able to access jsonObject from input. The garbage collection will just clean it up because it can’t be accessed anylonger.

answered
1

It’s because the association needs to be the other way around. Multiple jsonObjects need to be associated with a single Input object. In your domain model, the association is the wrong way. Start at JsonObject and end at Input.

answered
0

In domain model i’ve the association : 

BUT in my mapping I can’t add Input as association : 

answered
0

If I do like this :

This is working and I get the servertime. BUT I can’t access my Temp and Humidty :

answered