Create a global data model

You can create a global data model in TotalAgility. A global data model is available to all processes, rules, custom services and forms.

  1. Navigate to System data > Data models.

    The Data models page appears.

  2. Click New.

    The new data model appears in a tree form under the Design tab and opens in a new browser tab.

  3. You can change the default name and provide a meaningful and unique name for the data model. A name can have a maximum of 40 characters.
  4. Optional. Provide a Description for the data model.
  5. By default, the data model is placed in your default working category. To place it in a different category, on the Category list, select a category.
  6. Add fields to your data model.
  7. Save or release the data model.

    The new data model appears on the Data models list page.

Add fields to a data model

You can add fields to a data model and then add child

  1. Do either of the following to add a field:
    • Click adjacent to the data model. By default, a new field, FIELD1 of type Text is added to the data model. You can change the field name by double clicking the field.

    • On the Field list under Design tab, select a field type. The selected field type is added to the data model.

  2. Provide a meaningful and unique Name for the field.
  3. On the Type list, select a field type. The supported field types are:

    • Text: String

    • Boolean: (Default: Clear)

    • Date: (Default: Current date)

    • Number: Includes decimals and integers. (Default: 0)

    • Object: Includes nested objects; up to nine levels of nested objects are supported.

    • List: Repeating data can be represented in lists. Lists can be simple types or a list of name objects. A list can include column fields of Text, Boolean, Date, Number, Object and List type.

      Note You cannot add an object or list field to the 9th level of your nested object and list fields.

  4. Optional. Provide a Default value.

    A default value is assigned when the data model gets created.

    Note The default value is only available for boolean, date, and number field types.

  5. Repeat the preceding steps to add more fields.

    To delete a field, click for the field.

  6. If needed, create child fields within a field.

Set a list child field as unnamed

You can set a list child field to be “unnamed”.

An unnamed child field can only exist under a list field and can only contain simple data types.

A parent list field can contain only one unnamed child field.

If the fields are unnamed then the first item of the list is used to determine the type of the items in the array.

Note TotalAgility does not support mixed arrays, that is, an array with entries of different data types such as String and Number.

In the following JSON example, the text in bold is a list of unnamed items that is held as a child element in an object.

{
  "make": "VOLKSWAGEN",
  "model": "TIGUAN",
  "dateFirstUsed": "23 JULY 2009",
  "fuelType": "DIESEL",
  "colour": "SILVER",
  "engineSize": "1968",
  "registrationDate": "23 JULY 2009",
  "manufactureDate": "23 JULY 2009",
  "manufactureYear": "2009",
  "motTestReports": [
    {
      "testDate": "27 NOVEMBER 2020",
      "expiryDate": "26 NOVEMBER 2021",
      "testResult": "PASS",
      "odometerReading": 99946,
      "odometerUnit": "mi",
      "motTestNumber": 647548533803,
      "advisoryItems": [
        "Front Shock absorbers light misting of oil or has limited damping effect  both (5.3.2 (b))",
        "Nearside Rear tyre perished tread area",
        "Nearside Front tyre getting low 3mm",
        "brake discs worn"
      ],

  1. Select the list field for which to create an unnamed child field.
  2. Click .
  3. Enter a Name and Display name for the child field.
  4. On the Type list, select simple data types such as Text.
  5. Select Unnamed.

    The child field is treated as an unnamed special field.

  6. Optional. Provide a Default value.