Property description
The template property defines the form that’s requested via an API call. Forms can be added as actions for the section title component.
Minimal JSON
{
"type": "",
"title": "",
"apiDataKey": "",
"elementType": ""
}{
"type": "form",
"api": "https://help.dawiso.com/api/url/1",
"formId": "unique ID within package",
"title": "title.translationKey",
"successApiCallToast": "title.translationKey_success",
"errorApiCallToast": "title.translationKey_error",
"template": [
{
"type": "form-attribute",
"title": "title.translationKey_1",
"apiDataKey": "api_data_key_1",
"elementType": "is_checkbox",
"api": "https://help.dawiso.com/api/url/1"
},
{
"type": "form-user",
"title": "title.translationKey_2",
"apiDataKey": "api_data_key_2"
},
{
"type": "form-user",
"title": "title.translationKey_3",
"apiDataKey": "api_data_key_3",
"isMultiselect": true
},
{
"type": "form-user",
"title": "title.translationKey_3b",
"apiDataKey": "api_data_key_3b",
"includeGroups": true
},
{
"type": "form-relation",
"title": "title.translationKey_4",
"apiDataKey": "api_data_key_4",
"relationTypeKey": "core_related"
}
]
}Nested properties
| Property | Description | Values | Mandatory |
|---|---|---|---|
type | Form type. See supported type values. | string | Yes |
title | Translation key of the title. Define the key in translations to specify how the text is displayed in the UI. Unlike the name property, if you use a specific string of text for the title, this text will appear with the package key. For example, Comment Section will be displayed as package_key_comment section. | string | Yes |
apiDataKey | Unique key of the API data. | string | Yes |
elementType | Form field type. Supported values are: is_checkbox, is_multiline, is_single_line, api | string | Yes* (for form-attribute) |
relationTypeKey | Relation type (e.g., related). | string | Yes* (for form-relation) |
api | API URL when elementType is api. | string | No |
isMultiselect | Only for form-user. When true, the selector allows picking multiple users. The submitted array under apiDataKey holds user IDs, and group IDs too when includeGroups is true. Defaults to false (single user). | boolean | No |
includeGroups | Only for form-user. When true, the selector also offers user groups, for single and multiple selection alike. Defaults to false (users only). A group ID can then be submitted, so the api endpoint must accept both user and group IDs. | boolean | No |
Supported type values
| Value | Description |
|---|---|
form-attribute | Adds an attribute field to the form. |
form-relation | Adds a relation type selector to the form. |
form-user | Adds a user selector to the form. Set includeGroups to also offer user groups. |