Find the insights and best practices about our product.
Making Forms Dynamic with Rules
Show, hide, require, lock or fill fields automatically based on what the user enters.

Making Forms Dynamic with Rules

Rules make a form react while people fill it in. A rule says: if these conditions are met, then do this, otherwise do that.

The Rules Tab

Open the Rules tab in the Form Builder. The left panel lists each rule with a plain language summary, and edit and delete icons. The canvas shows a map of Columns triggers, Rules and Affected columns, with zoom and fit controls and a minimap.

The Rules tab with three rules and the map of trigger columns, rules and affected columns.

Figure F4.1: The Rules tab.

Create or Edit a Rule

  1. Click New rule at the bottom of the rules list, or the edit icon of a rule.
  2. Enter a Rule name.
  3. Under If these conditions are met, choose AND or OR, then pick a field, an operator and a value. Use Add condition for more rows and Add group to build conditions like A and (B or C).
  4. Under Then do this, pick an action and the target field. Use Add action for more.
  5. Under Otherwise, add the actions for when the conditions are not met.
  6. Check the summary at the bottom and click Save changes.

The rule editor with an Annual Revenue is not empty condition, Show actions and Hide otherwise actions.

Figure F4.2: The rule editor.

Operators

  • Text fields: Is, Is not, Contains, Does not contain, Starts with, Ends with, Is empty, Is not empty.
  • Number and date fields: Is, Is not, Is greater than, Is less than, Is empty, Is not empty.
  • Choice and Yes/No fields: Is and Is not.

Actions

Show, Hide, Make required, Make optional, Set value, Clear value, View only and Make editable.

At Runtime

Rules run instantly as values change, also across the steps of a wizard. For example, choosing Email as the Preferred Method of Contact makes Email required.

A quick edit form where Email shows a required marker after Email was chosen as preferred contact method.

Figure F4.3: A rule making Email required.

Example Rules

  • Ask for credit terms only when revenue is known: if Annual Revenue is not empty, show Credit Limit and Payment Terms, otherwise hide them.
  • Email required when it is the preferred channel: if Preferred Method of Contact is Email, make Email required, otherwise make it optional.
  • Customers need an account number: if Relationship Type is Customer, make Account Number required, otherwise optional.
  • Lock terms on credit hold: if Credit Hold is Yes, make Credit Limit and Payment Terms view only.

Good to Know

  • A field cannot trigger a rule that changes the same field. Pick a different field.
  • Every condition needs a field and a value.
Did this answer your question?