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.
| Property | Description |
|---|---|
| fieldid | An unique ID. A GUID is advised. |
| order | The order of the field in the form. This is a whole number. |
| type | The field type. |
| title | The title (label) of the field |
| required | If 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.
| Property | Description |
|---|---|
| fieldid | The unique ID of the related field of type "Select". |
| order | The order of the value. This is a whole number. |
| value | The select value |