Table of Contents | ||||
---|---|---|---|---|
|
What is the Form Config?
The Form Config is the central configuration file of a form. It defines things like:
How the fields of a form must be positioned in the view (= the view / layout).
Where to load and write the form model from / to.
Where to load the schema of the form /wiki/spaces/DEV/pages/2482176001 from.
What to do, after a form has been submitted.
Title, description, type and other settings of the form.
...
All form configs inside the form folder will be automatically picked-up and shown in the forms overview of an app. For example, here you can see the form Add person
automatically listed:
...
Configuration Attributes
The form config contains different attributes in order to specify the form. All of these attributes are described in detail below.
title
The title
defines the title of the form to be displayed in the web ui and in other locations.
This can be a static text or an i18n uri like $uri:i18n:myTitle
for example.
description
The description
is optional and describes the intention of the form.
This can be a static text or an i18n uri like $uri:i18n:myDescription
for example.
icon
Each form can have an individual icon. This value must be a code name from the Google Material Icons as listed here: https://fonts.google.com/icons
This value is optional. If not given, the icon with code name ballot
is shown as default:
...
color
The color of the form icon. If not given, the secondary color is used, which depends on the style settings. By default this is a blue color like this:
...
Another example:
"color": "red-8"
...
schema
The schema
attribute defines a PIPEFORCE URI which is called in order to retrieve the Form schema for this form.
...
Code Block | ||
---|---|---|
| ||
{ "type": "object", "properties": { "firstName": { "type": "string", "title": "First Name", "description": "The first name of the person." }, "lastName": { "type": "string", "title": "Last Name", "description": "The last name of the person." }, "age": { "type": "number", "title": "Age", "description": "The age of the person." }, "gender": { "type": "string", "title": "Gender", "description": "The gender of the person.", "enum": [ "male", "female", "neutral" ] }, "birthDate": { "type": "string", "format": "date", "title": "Date of birth", "description": "The date of birth of the person." } } } |
output
The output
defines the path in the property store where the form data must be stored as JSON property after the form has been submitted. Example:
...
input
The input
attribute defines a PIPEFORCE URI which is called to retrieve the initial input data for the form in order to set predefined values on the form widgets. For example, the input parameter could look like this in order to load a JSON property from the property store:
...
Code Block | ||
---|---|---|
| ||
{ "firstName": "Alice", "lastName": "Smith", "age": 20, "gender": "female", "birthDate": "2003/05/01" } |
forwardOnSuccess
Status | ||||
---|---|---|---|---|
|
onSuccess
instead.This attribute defines an URL, or a path relative to the portal in order to forward to after the form has been submitted successfully. In case the submit caused an error, the form will stay at current location in order to display the error. In case this attribute is not given, the form will show the default submit success message.
onSuccess
Status | ||||
---|---|---|---|---|
|
This defines what should happen in case the form was successfully submitted. This is optional. If not defined, the default success message and icon will be shown:
forward
Forwards to a URL or a path relative to the portal. In case the submit caused an error, the form will stay at current location in order to display the error:
...
action
- must be set toforward
.url
- The URL or the path relative to the portal where to forward after success.
message
Shows a text message and an icon in case the form was successfully submitted.
...
action
- Must be set tomessage
.text
- Can contain a static text or an i18n key. If not given, the default text will be shown.
See: TODOicon
- Must be a code name from the Google Material Icon. If not given, the default icon will be shown. See: https://fonts.google.com/icons .color
- Defines the color of the icon. If not given, the default icon color will be shown.
See Colors .
layout
TODO
type
TODO
Internationalization (i18n)
TODO
Special Form Types
Document Understand Form
TODO
Variable substitution
Request parameters
Note |
---|
Status as of May 08th 2023:
|
...
These attributes in the form config support request parameter variable substitution:
input
output
schema
Property attributes (PEL)
Note |
---|
Status as of May 08th 2023:
|
...
In this example the PEL #{var.property.uuid}
will be resolved to the UUID of the property which is about to be created when sending this output.
Form Scripting
TODO: Add final description here. See here and add parts of it to this documentation which are finalized: https://logabit.atlassian.net/wiki/spaces/DEV/pages/846233616/PRD11+-+Forms#P1:-Form-script
...