Screens
To create a valid form, you need to understand the structure and elements of the Screen
class. Below is a detailed documentation of each element of the Screen
object.
Screen Object
A Screen
object represents a screen in the form and contains various elements such as components, fields, layouts, and navigation details.
JSON Example
{
"components": [...],
"fields": [...],
"layout": {...},
"next_screens": [...],
"screen_name": "Example Screen",
"next_button": "Next",
"previous_button": "Previous",
"buttons": {...},
"ai": {...},
"progression": true
}
Elements of Screen
components
- Type: List of
Component
- Mandatory: true
- Description: A list of components that are part of the screen.
- Documentation: Creating a Valid
Component
Example:
"components": [
{
"type": "text",
"data": "Example Text",
"name": "example-text"
}
]
fields
- Type: List of
FieldRef
- Mandatory: true
- Description: A list of field references used in the screen.
- Documentation: Creating a Valid
FieldRef
Example:
"fields": [
{
"slug": "my-field-slug",
"metadata": {},
"default": "this is a deault value for a Text field",
}
]
layout
- Type:
Layout
- Mandatory: true
- Description: Defines the layout of the screen.
- Documentation: Creating a Valid
Layout
Example:
"layout": {
"type": "column",
"children": [
{
"type": "component",
"name": "example-component"
}
]
}
next_screens
- Type: List of
ScreenLink
- Mandatory: true
- Description: A list of links to the next screens based on conditions.
- Documentation: Creating a Valid
ScreenLink
Example:
"next_screens": [
{
"condition": "true",
"screen_name": "Next Screen"
}
]
screen_name
- Type: String
- Description: The name of the screen.
Example:
"screen_name": "Example Screen"