Skip to main content

Adding Business Rules to Dynamic Forms

Configure show/hide rules, text validation, and conditional logic in form fields.

Written by James Ross

Overview

Business Rules add conditional logic to your dynamic forms. They control when fields are shown or hidden, validate input against specific patterns, and define behaviour based on user selections. This article covers creating, editing, and deleting business rules.

What Can Business Rules Do?

  • Show/Hide fields — display a field only when a condition is met (e.g. show "License Plate" only when "Has Vehicle" is checked)

  • Text validation — enforce minimum/maximum length, or require input to match a pattern (e.g. letters only)

  • Conditional logic — trigger different behaviours based on dropdown selections, checkbox states, or other field values

Adding a Show/Hide Rule

Quick Steps

  • Open the form designer with at least two fields (e.g. a checkbox "Has Vehicle" and a text field "License Plate")

  • Select the field that should be conditionally shown (e.g. "License Plate")

  • Open the Business Rules panel in the DCM

  • Click Add Rule

  • Configure the rule:

    • WHEN — select the trigger field (e.g. "Has Vehicle")

    • IS — select the trigger value (e.g. "Checked")

    • THEN — select the action (e.g. "Show" this field)

  • Save the rule

Testing the Rule

  • Preview the form with the trigger field in its default state (e.g. "Has Vehicle" unchecked) — the conditional field should be hidden

  • Change the trigger (e.g. check "Has Vehicle") — the conditional field should appear

  • Revert the trigger — the field should hide again and its value should be cleared

Adding Text Field Validation Rules

Text fields support additional validation beyond the Required toggle:

  • Select a text field and open the Rules / Business Rules panel

  • Set minimum length (e.g. 3 characters)

  • Set maximum length (e.g. 50 characters)

  • Set a pattern regex (e.g. ^[A-Za-z ]+$ for letters only)

  • Save the rules

Validation Behaviour

  • Input shorter than the minimum length → validation error

  • Input longer than the maximum length → validation error

  • Input that doesn't match the pattern → validation error

  • Input that meets all criteria → accepted

Editing a Business Rule

  • Select the field with the rule

  • Open the Business Rules panel

  • Click to edit the rule — the rule editor opens with current conditions pre-filled

  • Modify the condition (e.g. change the trigger value)

  • Save and preview to verify the updated behaviour

Deleting a Business Rule

  • Select the field with the rule

  • Open the Business Rules panel

  • Delete the rule

  • Preview the form — the field should now behave normally (e.g. always visible if the show/hide rule was removed)

Important: Deleting a rule does not restore field values that were cleared by the rule. If a show/hide rule cleared a field's value when hidden, that value remains empty after the rule is deleted.

Default Value Rules

Certain field types support Default Value rules that pre-populate a field when the form is opened. These are configured on the Rules tab of the field in the form designer.

Date Field — currentDate()

Date fields offer a Default value selector on the Rules tab with two options:

  • None — no default (the field starts empty)

  • currentDate() — automatically fills the field with today's date

Behaviour:

  • When the form is opened and the date field is empty, currentDate() fills it with today's date

  • If the field already has a saved value, currentDate() does not overwrite it — the existing value is preserved

Important: currentDate() is a one-time default on form open. It does not update dynamically if the form remains open past midnight.

Select User Field — currentUser()

Select User fields offer a Default value selector on the Rules tab with two options:

  • None — no default (the field starts empty)

  • currentUser() — automatically pre-fills the field with the logged-in user

Behaviour:

  • When the form is opened and the field is empty, currentUser() pre-fills it with the person viewing the form

  • If the field already has a saved value, currentUser() does not overwrite it — the existing value is preserved

  • If the current user is not in the selectable list for that field, the field stays empty — no error is shown

  • currentUser() works on Select User fields inside repeaters — each new repeater row defaults to the current user

Important: currentUser() resolves to the person viewing the form, not the person who originally submitted it. On reopen, the saved value takes precedence.

Further Information

For configuring field properties, see Configuring Form Field Properties. For previewing and testing rules, see Previewing and Testing a Dynamic Form.

Did this answer your question?