Form definition

Each action (template) has a form definition.

A form definition could be empty. In that case, a message must be displayed that the form contains no fields.

A form definition could also be a JSON following a fixed format. In that case, a form is rendered when accessing the screen “Action” in the main app.

The JSON has the following structure:

				
					[
  {
    "fieldid": "...",
    "order": ...,
    "type": "...",
    "title": "...",
    "required": "..."
  },
  {
    "fieldid": "...",
    "order": ...,
    "type": "...",
    "title": "...",
    "required": "..."
  },
  ...
  {
    "fieldid": "...",
    "order": ...,
    "type": "...",
    "title": "...",
    "required": "..."
  }
]
				
			

There is a record per field. The table below describes the field properties.

PropertyDescription
fieldidAn unique ID. A GUID is advised.
orderThe order of the field in the form. This is a whole number.
typeThe field type.
titleThe title (label) of the field
requiredIf the field is required or not. The possible values are "Yes" and "No".

Fields of type “Select” need some extra attention because they need select values. There is a dedicated column for this in the  tables action and action template called “Select values”.

This column need JSON following a fixed format. The JSON has the following structure:

				
					[
  {
    "fieldid": "...",
    "order": ...,
    "value": ""
  },
  "fieldid": "...",
    "order": ...,
    "value": "..."
  },
  ...
  "fieldid": "...",
    "order": ...,
    "value": "..."
  }
]
				
			

There is a record per field. The table below describes the field properties.

PropertyDescription
fieldidThe unique ID of the related field of type "Select".
orderThe order of the value. This is a whole number.
valueThe select value

Print this page