Select the integer part of an http response and display it: how to?

0
Hi all,   I’m trying to create an age estimation app. Mendix is the front end, stores the image, calls the API from UbiOps (SaaS serving/hosting platform), where the ML model runs to estimate the age, and receive the “age” back as an integer and displays it.  However, the API sends along more info than just the integer.  Where / how do I select just the integer and display that?  See below some pictures to give you an idea of the workflow.  Thank you very much for thinking along! Wouter  
asked
3 answers
0

If the REST service is sending back more information than just an integer, I assume it’s sending either JSON or XML? If this is the case, then look at producing an Import Mapping to read the response and extract the data you need.

https://docs.mendix.com/refguide/mapping-documents

answered
0

Hi Robert,

 

Thanks for you response. 

It’s indeed JSON. I’ve had a look at the mapping documents. Is there perhaps a guide how to map incoming JSON data from a post rest call? 

I’m having difficulty creating the mapping. 

Best,

Wouter

answered
0

Hi Robert, 

Thanks. With help I managed to build the flow and map the API response. However, from UbiOps I’m getting an error that the request body is not a valid JSON type. How do I include a variable of type string in a JSON payload for consuming the REST api?
Do you know how to solve this?

answered