How to fetch multiple objects from JSON responses

Sam van de Kreeke

Published: 25-10-2019

Last updated: 27-08-2020

  1. Go to Tools on the builder menu left and click on 'Webservices'.
  2. In this howto we are using an existing web service.
  3. Create new endpoint to the web service.
  4. Define all endpoint settings as Name, Http method, Path, and its Custom Model.
  5. In this howto we are using an existing custom model definition. Select the custom model and the select 'list of objects' as a return.
  6. Save the endpoint.
  7. Go to Actions on the builder menu left.
  8. Create a new action to fetch the collection and to assign to your data model.
  9. Create a new Http request action event.
  10. Select the web service and endpoint to complete the request.
  11. Give the requested object a variable name 'As'. Please remind that it is a collection of objects not a single object.
  12. Below the Http event we have to loop through the collection of objects.
  13. Select the collection in the loop event.
  14. Give every single object in the collection a variable name 'As'.
  15. Insert in the loop a new create event. Select the right model from the data model.
  16. Assign all the properties of the model to the attributes from the custom model.
  17. Give every new comment a variable name 'As'.
  18. Run the action manually.
  19. Ignore the time out warning. In this case we fetched over 500 objects. This warning is a normal procedure.
  20. Go to your back office and to check if all objects are fetched and assigned.
In this tutorial

Not sure where to start?

Click here to register and start learning