Condition operators
This page lists the operators a Condition Block offers for each field type. You need it when you build a condition and want to know which operators a field offers.
The example is the Blog post template, previewing AI 101, where a Condition Block tests the Related posts field.
Operators by field type
Studio can test text, number, date, boolean, single select, multiple select and list fields, assets, references and modular blocks. It disables fields of other types, such as a group like SEO.
| Field type | Part you select first | Operators |
|---|---|---|
| Text | None | Equals, Not Equals, Contains, Starts with, Ends with, Matches, Is empty, Is not empty, Exists, Does not exist |
| Number or date | None | Equals, Not Equals, Greater Than, Greater Than or Equal, Less Than, Less Than or Equal, Exists, Does not exist, Is empty, Is not empty |
| Boolean | None | Equals (value True or False), Exists, Does not exist, Is empty, Is not empty |
| Single select | None | Equals and Not Equals (value is one of the field's options), Exists, Does not exist, Is empty, Is not empty |
| Multiple select | Selection, Length or Presence | Selection offers Includes and Excludes |
| Asset | Extension, Size or Presence | Extension offers Equals and Not Equals. Size offers the six comparison operators, with a number. |
| Reference | Content Type, Length or Presence | Content Type offers Equals, and you select one of the field's content types |
| Modular blocks | Block Name, Length or Presence | Block Name offers Equals, and you select one of the blocks |
| List field, such as a list of text | Length or Presence | Length and Presence, listed in the next table |
Operators for Length and Presence
Length and Presence offer the same operators on every field that asks for them.
| Part | Operators | Value |
|---|---|---|
| Length | Equals, Not Equals, Greater Than, Greater Than or Equal, Less Than, Less Than or Equal | A number |
| Presence | Exists, Does not exist, Is empty, Is not empty | None |
Rules for Is empty, Exists and Matches
- Is empty, Is not empty, Exists and Does not exist take no value.
- To check that a field has a value, use Is not empty. Exists is true for any field the entry has, even one with an empty value.
- Is empty is true for an empty string, a missing field, an empty list and an empty object. A value of 0 or false is not empty.
- Text comparisons ignore letter case, except Matches. Matches reads the value as a regular expression.
Where to go next
- Build a condition with these operators: Show or hide content with a condition.