PAK Commands – Create Form From Template
1. Summary
This command lets you create a multi form page from a JSON-Template, which the user has to fill out to continue.
2. Examples
Due to simplicity, the descriptiveText
input parameter will be left empty for the examples. By default, it is set to „Please fill out the form below to continue“.
The jsonTemplate
input field takes a JSON form template creating the form. For example:
[
{
"label": "First Name",
"dataType": "text",
"fieldId": "firstName",
"initialValue": "John",
"mandatoryField": "true"
},
{
"label": "Last Name",
"dataType": "text",
"fieldId": "lastName",
"mandatoryField": "true"
},
{
"label": "Age",
"dataType": "Number",
"fieldId": "age"
}
]
In general the form will be created corresponding to the following pattern: [{Form Field 1},{Form Field 2},…]
Describing one form field after another, setting all the parameters by naming the key and the corresponding value.
The form needs to at least contain one Form Field for the command to work.
The possible parameters (JSON-keys) for a form field are:
Name of Data | Purpose |
---|---|
|
This is the name of the input |
|
This is the data type of the input field. Possible types are: |
|
This is the key of this form field when it gets saved in a JSON object |
|
The prefilled value of this form field when opening the form |
|
This classifies if this form field needs to be filled out to continue |