The Conditional Button Control provides a single button to the agent that can then navigate to different Pages depending on specified conditions. This allows for simpler and faster usage by the agent, or additional control over the Workflow's path by the designer.
This can be contrasted with the
GoToPage, where the agent manually chooses an option from a list to select the next Page to navigate to.
This Control is part of the Intermediate Control pack, and will only be available if your System has the appropriate licence.
Add a Conditional Button to the Page. The options and style can be configured in the
Options tab and
Styling tab of the Field Properties.
Conditional Button Fields can be styled in a Stylesheet by referencing the control-conditional-button class.
The Advanced Options tab allows the conditions and destinations to be specified:
Additional conditions can be added by clicking the Add button below, and will appear as new blank "else if" rows. "If" and "else if" rows need to have a condition specified, which can be set by clicking inside the first box on each row and entering the JavaScript for the condition. All rows also require a destination Page to be set in the final box of each row. When clicked, the first condition that succeeds (evaluates to a JavaScript
true or implicitly
truthy value) will cause the Workflow to navigate to the matching Page.
Options (excluding the "else") can be re-ordered by dragging the arrow icon to the left side of their row.
As with other button-type Fields, it is possible to require that a Page passes
Validation before the button will activate. This prevents the agent from leaving the Page before all requisite details have been collected.
As with other button-type Fields, upon activation the button will then be temporarily disabled until the action has completed.
As with other button-type Fields, it is possible to trigger this by JavaScript or
Update Links. Please see the
.click() article for more information and an example regarding using JavaScript.