In the condition builder, Compare values… takes a left value, an operator and a right value. Check a value… takes one value and a check. This page explains each.

Compare values

Examples, as you’d fill them into the builder:
  • $record.status equals draft
  • $input.quantity is at least 1
  • $record.publish_at is at most $now
  • $input.status is one of draft, submitted
  • $auth.user_id is not one of $record.blocked_ids
  • $auth.roles contains admin
  • $object.key starts with public/
  • $auth.email ends with @acme.com
  • $input.slug matches regex ^[a-z0-9-]+$
A pattern for matches regex is checked when you save; an invalid one is refused.
ends with @acme.com on $auth.email is a handy company check, but only meaningful if emails are verified. Also require Check a value: $auth.email is set, and turn on Require a verified email in Restrictions, or use company sign-in.

Ids are matched either way

A database id may be a number on one side and text on the other (a token carries text). equals and is one of treat them the same, so $record.owner_id equals $auth.user_id works for either id type.

Missing values

If a side is missing (empty), the greater/less comparisons are false. equals with a missing side is true only if the other is also missing. is one of with a missing list is false; is not one of with a missing list is true. Plan for this: a record with no publish_at never passes $record.publish_at is at most $now.

Check a value

These take one value:
  • Check a value: $auth.user_id exists
  • Check a value: $auth.org is set
  • Check a value: $record.deleted_at is empty

Choosing between them

  • “Is the same as” → equals. “Is one of a fixed set” → is one of.
  • “Has this role” → the Has role kind, or $auth.roles contains admin.
  • “Has a real value” → is set; exists only checks it is present, so an empty text passes exists but fails is set.

Combining

All, any and none.

Values and paths

Types and missing values.