Display rules control how a form is displayed. You can hide or show form inputs and change input labels based on other form and record values.
These rules are checked and triggered both when the form is initially loaded and when a user changes the value of an input.
A display rule is added by defining the conditions (if) that trigger the actions (then):
Knack Tip: With a multi-part form, you may want to use display rules to show/hide fields based on fields from an earlier part of the form. In this case, you can add the field triggering the display rule to the form itself. You will have to use a display rule to hide that field on the form, but you'll still be able to use it for other display rules.
These are the conditions which will trigger your rule’s action(s) when the rule’s condition(s) is/are true. You can add more than one condition to trigger the action, in which case every condition must be true.
This is the action to trigger when the condition(s) is/are met.
Show the input when the condition is true. Hide the input when it is false.
Show the Shipped date field on a form to add an Order record when the Shipped? yes/no field’s value is Yes. This way, if the user changes the value of Shipped? from No to Yes while filling out the form, Shipped date will still appear.
Hide the input when the condition is true. Show the input when it is false.
Show an Other (short text) field input when the choice selected for How did you hear about us? Is Other, allowing the user to add an option only when appropriate.
Show the input when the condition is true. This option will not hide the input whenever the conditions are not met.
Unlike Show/Hide, this option only performs a single action. If you need the rule to do the opposite when a variable on the page changes, you'll need to add another rule that states the opposite.
Note: This rule is not needed on views (eg. a Details view) where only static information is displayed. If field inputs are on a view and the value matches other required criteria (eg. yes, it has a value), you do not need a "Show" display rule. That value will automatically display on the view.
On a form to edit an Appointment record, have a rule to show the Appointment date and time field only when the same field’s data is before today, preventing the user from rescheduling an appointment on the same day.
Hide the input when the condition is true.
Unlike Hide/Show, this option only performs a single action. If you need the rule to do the opposite when a variable on the page changes, you'll need to add another rule that states the opposite.
Hide the Late fee field if Due date is before the current time. This prevents the user from adding a late fee when one was not necessary and is intended for a form where Due date could not be edited.
Change the label of the input when the condition is true. This is best used for minor aesthetic or usability tweaks.
With a Car or truck? multiple choice field, rename the label for the Mileage field to either Car mileage or Truck mileage, depending on the user’s choice.
Order of Operations
Display rules run top to bottom.
Display rules don't stop running when a rule is matched. So if there's a match on the first rule and later there's a match on the third rule, the last rule will take precedence.
On Detail Views
Display rules on Detail views are applied differently than on other views as this view type can only display static information for a single record.
- Field values are automatically shown if they have a value; "Show" rules are typically not needed on Detail views.
- When the "Then" action is to show a field when a condition is true, it gets hidden it if the condition is false.
Notes & Troubleshooting
If you hide a field on a form, any value in that field won't be stored.