Add logic to a form
In Forms, you can create dynamic forms containing fields whose visibility depends on the responses to other fields. This creates a personalized and interactive experience, improving engagement and the chances of successful completion of the form.
Forms can be designed for various purposes, such as surveys, registrations, and bookings, with fields appearing based on context. Users only see only the fields that are relevant, reducing form clutter and improving usability. By hiding unnecessary fields, or setting other fields as required, depending on what someone has entered so far, the form guides users through the process, reducing errors and improving success rates.
To add logic to a form:
-
Create or open a form that has at least two fields.
-
On the Logic tab, click Add logic.
-
In the first section When the following conditions are met, add your first condition:
-
In the first drop-down menu, click the item for which you want to create a conditional logic.
-
In the second drop-down menu, select one of the following terms for the conditional statement, as appropriate: contains, does not contain, is equal to, is not equal to, starts with, ends with, is empty, or is not empty.
-
In the third field, enter the desired value for the condition. Values are case insensitive.
-
-
If needed, click Plus
to add multiple conditional terms and values for the same item. These conditions are separated from each other by the OR operator, so only one needs to be true for the condition to be satisfied.
-
If you want to add conditions for other items, you can do so in the following ways:
-
Click Add condition to add a new condition separated from the others by the AND or OR operator.
-
Click
> Create group to add a group of conditions. The conditions in the group are separated from each other by the AND or OR operator. All conditions in a group evaluated together and the result is used for comparison with the adjoining logic.
-
-
To duplicate a condition or a group of conditions, click
> Duplicate. -
Conditions and groups are evaluated in the order they appear in the list, with the top-most condition evaluated first. To adjust the position of a condition or group, click
> Move up or Move down. -
In the second section Then execute the following actions, you can define the actions that occur when your conditional logic returns a value of true. Click Add action and use the drop-down menus to define the first action as follows:
-
In the first drop-down menu, click: Hide field, Show field, Make a field required, or Make a required field optional.
-
In the second drop-down menu, click the item you want the action to be applied to.
-
-
If needed, click Add action to define additional actions for this condition logic.
-
To remove any conditions or actions, click
. Alternatively, click
> Delete. -
When you have finished building the form's logic, click Save.
You can define more than one independent set of logic for a single form. When a user's actions satisfy the conditional logic of the form, the defined action (such as hiding a field) will happen automatically.