The Form Designer's Form Logic tab displays and allows you to edit logical rules that specify the Form flow. These rules can be created directly within the Form Logic tab or via the Form's Conditional properties.
For example, you may want to determine which fields are visible depending on what the respondent selects in a "Job Title" field, or you may want to auto-populate or lock field values based on answers provided in certain key fields. With Form Logic, you can do all of this and more.
Viewing and Creating Form Logic
To access Form Logic, navigate to the Form Logic tab within the Form Designer. If your If the Form does not yet contain any logic, you will be presented with a "No logical rules" message and an Add New Rule button:
Any rules created via the Form's Conditional properties will also display in the Form Logic tab.
Clicking the Add New Rule button will present you with an interface where you can fill details into a logical rule with the structure of an if-expression:
To build your rule, click and specify each element:
- Click Select... to choose from a list of Form Fields present in the Form. Selecting a Field will cause that field and an Add Condition button to appears. Specify the value to check for in the field.
- Click Equals to choose from a list of operators: Empty, Not Empty, Equals, Does not equal, Contains, Does not contain, Greater than, Less than, Greater than or equal to, and Less than or equal to.
- Use the now-visible Add Condition button to add additional conditions to your rule, if desired.
- Click Select action... to choose the action that you want to execute when the conditions are met. The available actions are:
Show (hide) field: Show hidden field or hide a visible field.
Enable (disable) field: Enable a disabled field or disable an enabled field.
Make field required: Make an optional field required.
Reset field value: Reset a field to default value.
Set field value: Provide an expression whose result will be assigned to the target field.
Complete form: Complete the Form without gathering additional information.
Set field: Set a field to a specific value.
Copy field value: Set a field to a value copied from another field.
Skip to field: Skip the user to a specific field.
Run expression: Run a custom expression.
Set "Form Complete" page markup: Set the "Form Complete" page with specific content. - Finally, click the Done button to confirm and save your Rule.
As an illustration, here is a rule that makes an "Engineer Feedback" Form Field visible when the user selects "Engineer" for their Job Title and was hired on or before March 1'st 2025:
Clicking Done collapses the Rule Editor interface down into the logical expression for the rule within the Logic Tab:
From here, you can select your saved rule to re-open the Rule Editor interface, or you can click Add New Rule to create another rule. Any rules that you create within the Form Logic tab will become available within the relevant field's Conditions properties, and vice versa.
For more details about expression syntax, see our Expressions for Logic and Conditions in Form and Preference Center Designers article, as well as this Survey.js documentation.