Add a local data model

You need to define the structure to hold the vehicle details.

You can create data models globally (to reuse across forms or processes), or locally to a form or process. As you will only be using this data model on the form, you define the model locally to the form.

You can create the model manually, but most services give you a sample of what the response will be, so using a sample JSON is much quicker. In this tutorial, you will use the Vehicle Search API.

  1. On the Data models tab on the form, click New.
  2. Change the name of the model to Vehicle.
  3. Click Load from external source.

    The Load from external dialog box appears. Load from external dialog box

  4. Click the following URL:
  5. When the Vehicle Search API page appears, click Try it out.
    Vehicle search api
  6. Leave the default values for apikey and licencePlate and click Execute.
    Execute data model web api
  7. Copy the JSON sample from the Response body.
    Vehicle search api responce body
  8. Return to the TotalAgility Designer and paste the JSON sample into the File content box and click Add.
    JSON loaded from external site

    The fields are automatically added to the Vehicle data model structure.

  9. Click Add again to add the model to your form.

    Well done, you have created your first data model and added to your form! Continue to Create a form variable.