Display logic allows you to choose how and under what circumstances your field displays to respondents. For example, you hide a field or make it read-only or choose to show or hide it in specific situations.
To access display logic, hover over a field, and select the gear icon to open the field settings. Then, go to the Display Logic tab and make your changes.
Please note that some fields only have some display logic options, and some plans don’t have access to all options.
Display Logic Options
The options in the Display Logic tab vary between fields, but all available options are:
- Always show: The field will always be shown on the live form; this is the default setting.
- Always show as read-only: Respondents can see the field but not interact with it. This is useful if you want to use a field as an example or to convey information.
- Always hide: This field will always be hidden on the live form. This is useful if the field is helpful to your team, but not respondents, such as a calculation used to work out a payment. The payment field will show the same cost as the calculation, so users only see the information relevant to them. This is available on Team and Enterprise plans.
- Show or hide based on Smart Logic: Show or hide fields based on the prior answer of the respondent. Smart Logic is available on Team and Enterprise plans.
Set Up Smart Logic
To use Smart Logic, ensure all fields, groups, and sections have names you can reference, then:
- Hover over the field and select the gear icon.
- Go to the Display logic tab and select Show or hide based on Smart Logic.
- Choose Show or Hide from the drop-down menu.
- Select Add scenario to build and Add a rule that determines when you want the field or section shown or hidden.
- Save your scenario when you have added all the rules.
- Continue selecting Add scenario until you’ve built all the necessary scenarios.
- Save your form.
Smart Logic cannot reference specific fields within a repeatable group, but you can reference the sum of number and calculation fields within those groups, such as the sum of an itemized list of expenses.
Building Scenarios with Rules
Smart Logic scenarios use a respondent’s earlier answers to determine whether a field or section is shown or hidden. For example, an animal registration form might have different sections based on whether the respondent has indicated that they have a dog or cat, and you can use Smart Logic to guide them to the correct section.
Rules are built using variables specific to the field on which they’re based. There’s too many to list, but you can use variables such as:
- Date ranges
- Days of the week
- If an answer matches or contains a specific value
- If the respondent answered a specific way to a choice question
- Whether a previous field was shown or hidden
Please note that you cannot add rules based on a specific option for a prior field if you use a list to fill the options.
To build a rule:
- Use the drop-down menus under When: to choose the Section and Field that you want to base the rule on.
- Use the response drop-down menus to choose what answer will trigger the field.
- Select Add.
- Save the scenario to add it to the field.
- Save your form.
You can create as many rules as necessary for a scenario, and the rules will layer so that all conditions must be met to show the field. You can also create multiple cascading scenarios in which a respondent’s answer triggers multiple additional fields. OpenForms will check scenarios from top to bottom, and whichever one is valid first will be applied.
What Else?