Skip to content

Show or lock a block with rules

How-to6 minPractitioner

Before you start

Use block rules when a whole section of a formFormThe set of blocks and components people fill in for a module.Open glossary ↗ only matters sometimes. A “Bank details” block can stay hidden until the payment method is a transfer. An “Approval” block can lock once a record is approved. Rules read the values people enter in the form.

  1. Open the Forms tab of the module.
  2. In the header of the block, click the eye icon. The Block rules dialog opens.
  3. Choose the tab you need: Show when or Lock when.

The dialog starts with a sentence such as “Decide when this block appears and when people can change it. Conditions read the values entered in the form.”

Show a block only when a condition is true

Section titled “Show a block only when a condition is true”

On the Show when tab, the lead reads “Show the block when any condition below is true. With no conditions, it is always shown.”

  1. Click Add condition. A row starts with “If”.
  2. In Choose a field, pick the field to watch, for example Payment method.
  3. In Operator, pick one: is, is not, is greater than, is less than or contains.
  4. Enter the value, for example Bank transfer.
  5. Add more conditions if you need them. Each new row starts with “or”.
  6. Click Done, then Save on the form.

The block header now shows a chip, Shown conditionally, with the number of conditions. Click it to reopen the dialog.

Conditions are joined with OR: the block shows when any one of them is true.

The Lock when tab has two parts.

Only the creator can edit. A switch. The hint says “Everyone else sees the fields in this block as read-only.” The lock works when someone opens an existing record to edit it. If the signed-in user is not the person who created the record, the fields in the block are read-only. When a record is first added, nothing is locked.

Conditions. “Make the block read-only when any condition below is true.” Add them the same way as in Show when. The block header shows Locked conditionally with the number of conditions, or Creator edits only when the switch is on.

  • Duplicating a block copies its rules with it.
  • Block rules and field conditions are different tools. Block rules work on one block. Field conditions change single fields and can read any field of the form.

Check yourself

A block has two Show when conditions. When does the block appear?
Show the answer

When at least one condition is true. Show when uses OR. The dialog says to show the block when any condition is true. With no conditions the block is always shown.

Nour turns on Only the creator can edit for a block. When does it take effect?
Show the answer

When an existing record is opened for editing by someone who did not create it. The lock applies in edit mode. If the signed-in user is not the person who created the record, the fields of the block are read-only.

What's next

Last checked