Switch
A switch, a toggle switch, is another form element that can be utilized to create an intuitive user interface. The switch allows users to select a response by toggling it between two states. Based on the selection made by the user, the corresponding Boolean value of either true or false will be recorded and stored in the process instance values for future reference.
Configuring the switch element
Switch generic settings
The available configuration options for this form element are:
Process data key
Process data key establishes the binding between the switch element and process data, enabling its later use in decisions, business rules or integrations.
Properties
- Label: The visible label for the switch element.
The Label field supports Markdown syntax, enabling you to customize the text appearance with ease. To explore the Markdown syntax and its various formatting options, click here.
- Helpertext: Additional information about the switch element, which can be optionally hidden within an infopoint.
Datasource configuration
Default Value: The default value of the switch element (it can be switched on or switched off). The default value is switched on.
Validators
The following validators can be added to a switch element: requiredTrue
and custom
(more details here).
Hide/disable expressions
- Hide condition: A JavaScript expression that hides the Switch element when it returns a truthy value.
- Disabled condition: A JavaScript expression that disables the Switch element when it returns a truthy value.
It’s important to make sure that disabled fields have the same expression configured under the path expressions → hide.
UI actions
UI actions can be added to the Switch element to define its behavior and interactions.
- Event: Possible value -
CHANGE
. - Action Type: Select the type of the action to be performed.
For more details on how to configure a UI action, click here.
Switch settings overrides
There are instances where you may need to tailor settings configured in the Generic settings tab. This proves especially beneficial when you wish to adjust these settings to appear differently across various platforms such as Web, Android, or iOS.
Available override settings:
- Properties:
- Label: Override the switch label.
- Helper: Override helper text/info point.
- Expressions:
- Hide: Override the hide expression.
Overrides can always be imported/pushed from one platform to another:
Switch styling
Label position: The label of the Switch can be positioned either as start
or end
.
Switch style overrides options
Theme overrides refer to the ability to modify or customize the appearance and behavior of UI components by overriding default theme settings. This can be applied at various levels, such as specific elements or entire sections, and can be platform-specific (Web, iOS, Android).
Style options:
You can import or push the overrides from one platform to another without having to configure them multiple times.
Was this page helpful?