HowTo fetch multiple objects from JSON responses?


After you have seen this HowTo video and read this article you will know how a collection of objects is fetched from JSON responses.

Step 01
Go to Tools on the builder menu left and click on 'Webservices'.

Step 02
In this howto we are using an existing web service.

Step 04
Create new endpoint to the web service.

Step 05
Define all endpoint settings as Name, Http method, Path, and its Custom Model.

Step 06
In this howto we are using an existing custom model definition. Select the custom model and the select 'list of objects' as a return.

Step 07
Save the endpoint.

Step 08
Go to Actions on the builder menu left.

Step 09
Create a new action to fetch the collection and to assign to your data model.

Step 10
Create a new Http request action event.

Step 11
Select the web service and endpoint to complete the request.

Step 12
Give the requested object a variable name 'As'. Please remind that it is a collection of objects not a single object.

Step 13
Below the Http event we have to loop through the collection of objects.

Step 14
Select the collection in the loop event.

Step 15
Give every single object in the collection a variable name 'As'.

Step 16
Insert in the loop a new create event. Select the right model from the data model.

Step 17
Assign all the properties of the model to the attributes from the custom model.

Step 18
Give every new comment a variable name 'As'.

Step 19
Run the action manually.

Step 20
Ignore the time out warning. In this case we fetched over 500 objects. This warning is a normal procedure.

Step 21
Go to your back office and to check if all objects are fetched and assigned.

Next step:
 HowTo fetch nested objects from JSON responses?

Didn’t find what you want?Ask your question on the forum!