MaestroThe UI design product. | Form Builder | All versions This feature is related to all versions.
Maestro comes with the Mandatory if rule that requires valid input from a user before the user is allowed to continue with a form journey. The rule should be created and used to identify components that are essential to a form journey. This means that no matter what happens, the user should not be able to continue with the form until they have provided valid input for these components.
The Mandatory if rule requires a component to contain a value if a condition is true
meaning that the component is mandatory. Otherwise, the component is not mandatory and a form user may skip filling its details.
To create a Mandatory if rule:
data.$i >= 2
You don't need to use the return
statement if no local variables are created by the rule.
Let's look at a simple example. Suppose you want to make the first two checkboxes of the Repeating Block Template component to be not mandatory, but the rest to be mandatory. When a form user adds Disclosures, the 3rd and following ones are mandatory. The rendered form looks like this.
To implement this simple logic:
data.$i >= 2
You can also check a Mandatory if rule example.
Maestro also provides a quick way to mark a component mandatory, if you don't need to specify any logic so the component is always mandatory.
Next, learn about a Valid If rule.