Form logic allows you to add conditional rules to your forms. These rules can dramatically enhance the data collection experience for your users by changing the behavior of form fields depending on the data entered into other fields.
Each rule is composed of conditions and actions, similar to an "If/Then" statement. For example, if [X] field contains [Y] answer, then perform [Z] action. Some of the key capabilities of this form logic include:
Showing and hiding fields
ex. Hide the "Household Size" field if the user selects "Single" for the "Marital Status" field.
Making fields required or optional
ex. Set the "School Name" field to Required if the user selects "Student" for the "Employment Status" field.
Highlighting important fields
ex. Highlight the "Emergency Contact" fields if the user selects "Yes" for the "Has Dependents" field.
Follow the steps listed below to learn how to use form logic and set up each component of a form rule.
Notes:
Secure Fields cannot be used with Form Logic.
In order to deactivate a field used in a form rule, you must locate and delete all conditions and actions with the field selected.
Step 1: Enable form logic
In the Administrator tab, select the Standard Forms page from the Form Designer category of the navigation bar. Then, hover over the Actions menu next to the form you want to add form logic to and click "Edit" to open it in the Form Designer.
Click the top-most gear icon to open the form's properties, and check the "Enable Form Logic" box under Settings. Click "Apply" to close the Form Properties window.
Step 2: Edit existing fields
Locate the fields you want to use in your form rules. Check both the Section Properties and Field Properties for whether they were previously marked as Required or Hidden, as this may impact the effectiveness of your form logic depending on what you're looking to do.
In many cases, it's quickest to apply rules and actions to an entire section at once. You may consider moving certain fields into new or different sections in order to apply your form logic to particular sections.
Step 3: Add a new rule
At the bottom of your form under the System Fields section, you will find the Form Rules section. Click the "New Rule" button to add a new rule, then click the gear icon to the right of the name to edit its properties.
Set the rule name, then leave the "Show on Palette" box checked or unchecked depending on whether you want the name of the rule to be visible to users as they fill out the form or not. Select "Apply" to save your changes.
Step 4: Add a condition
Conditions describe what kinds of data entered in the form fields will set the form rule in motion. In practice, a condition is built similarly to a report filter.
Click the rule name to expand the rule, then select the + icon next to "Conditions" to open the Condition Properties. Select the field from the first dropdown that will govern the actions to follow. Then, choose an operator from the second dropdown which determines how the condition is evaluated (ex. "Equals", "Begins With", "Contains").
Notes:
The recommended operator for an Append Only field is "Is Empty" or "Is Not Empty".
The recommended operator for a multi-select field like Multi-Select Dropdown or Checkbox iw "Begins With" or "Contains".
Below the dropdown fields, state the value that should be compared to the value entered by a user in the selected field.
Click "Apply" to close the window.
You can also add more than one condition to a rule in order to trigger a certain action.
In the example below, users can mark a participant as a "Child", or the participant's age can be entered as less than 18 at the time of intake. Either of these questions' values can indicate the participant is a minor.
Once you've added a second condition to a rule, the Condition Logic section will appear. You can determine whether both conditions should be met in order to trigger an action by typing "1 and 2", or if only one of the conditions needs to be met by typing "1 or 2".
If you need to delete a condition, click the condition's name and select "Delete" from the Condition Properties window.
Step 5: Add an action
Actions describe what happens once the condition is met. They can be applied to an individual field or to a form section. The available actions for fields and sections include:
Individual fields
Require
Unhide (make visible)
Lock (make read-only)
Highlight
Use Lookup List
Set Value (cannot be used for Masked Option, Likert Scale, or Milestones/Goals fields)
Note: Set Value has a limit of 80 characters. Any characters entered after 80 will be truncated.
Form sections
Unhide (make visible)
Expand
Scroll to
Require All Fields Within
Lock All Fields Within
Click the + icon next to "Actions" to open the Action Properties. Under "Type," choose whether the rule should apply to one field or the form section. Select from the available actions in the dropdown, then choose which field or section to apply the rule to. Click "Apply" to close the window.
You can also add more than one action to a rule in order to impact multiple fields or sections. In the example below, if a participant is identified as a minor, then the "Child Information" section will be unhidden (in other words, become visible) and the "Current Grade" field will be required.
To delete an action, click on the action name and select "Delete" from the Action Properties window.
Step 6: Review your rules
Click on the rule names to expand them and view their current conditions and actions. Ensure that the form logic is sound and performs the appropriate actions you're looking to make within the form.
The form cannot be published until all form logic rules are fully configured. If you need to delete an unwanted rule, click the gear icon next to the rule name and select "Delete" from the Rule Properties.
Finally, publish your form to save your changes and make them available for data entry.