Knowledge base

How do I show, hide, lock or conditionally require fields on a form?

Put visibility rules on the target field, set edit rights per step in Permissions, and make a field required only when a condition is met.

Fix

Short answer: Put the visibility rule on the field you want to show or hide, not on the dropdown that controls it. Set edit rights per step in Permissions. To make a field required only in some cases, turn on Required? for the field and add a condition under Mark as required when. A hidden field is never checked, even when it's required.

Why it happens

  • Visibility rules hide a field or section wherever the condition is true, including in completed items.
  • A hidden section hides all its fields, even one set to Editable. An editable or read-only section sets only the fields that have no permission of their own.
  • Permissions are set per step, not per user. You can't make a field read-only based on another field's value.
  • Required fields are validated only when visible. Required table columns are checked only on rows that exist.
  • A field hidden through step Permissions isn't used by visibility rules on other fields.

How to fix it

To show a field only for one dropdown value:

  1. Open the target field or section and go to Visibility.

  2. Set Default visibility to Hidden.

  3. Click Add a visibility rule, then Add a condition, for example Dropdown is equal to "Travel".

    Visibility tab with Default visibility and Add a visibility rule

  4. Give each field or section its own rule when different values show different fields.

If a field won't edit at a step:

  1. In the process editor, open Permissions, select the step, and set the field and its section to Editable.
  2. For sent-back items, make the fields editable at the step the item returns to.

To make a field required only in some cases:

  1. Turn on the field's Required? switch.
  2. Under Mark as required when, add a condition that checks the controlling field.

To require at least one table row, set the table's minimum rows validation to 1, then turn on required for each column that must be filled.

To require at least one of several fields, add a helper text field with if(isBlank(F1) && isBlank(F2) && isBlank(F3), "Enter a value in one of the fields", "OK") and give it an Equal to "OK" validation.

If a visibility rule needs a helper field, don't hide the helper in Permissions. Put it in its own section and hide that section instead.

Important

Row-level edit rights in a table aren't supported; add a status column to tell rows apart. To edit values after completion, a Process Admin or a Data Admin can use Update field values in Administration.

Related answers