Condition
Where this goes: The when part of a display rule.
Read the practical guide · See an illustrated example.
The tables below list configuration keys. Required means the key must be present in the config; it does not mean a labeler must answer the field.
A rule’s trigger, evaluated over one record’s input values. Never throws: a condition pointed at a missing or wrongly-typed value simply does not fire.
Every variant shares the keys below. Which further keys are legal depends on op.
| Key | Type | Required | Notes |
|---|---|---|---|
op |
one of 19 values — see below | yes | Selects which shape the rest of this object takes. Every other key is validated against the variant named here. |
"op": "eq"
Section titled “"op": "eq"”True when the values are equal.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
string | number | boolean | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "ne"
Section titled “"op": "ne"”True when the values differ.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
string | number | boolean | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "gt"
Section titled “"op": "gt"”True when the field is greater than the comparand.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
number | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "gte"
Section titled “"op": "gte"”True when the field is greater than or equal to the comparand.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
number | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "lt"
Section titled “"op": "lt"”True when the field is less than the comparand.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
number | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "lte"
Section titled “"op": "lte"”True when the field is less than or equal to the comparand.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
number | no | The literal to compare against. Give this or otherField, not both. |
otherField |
string | no | Another input field to compare against, for rules that relate two columns. Give this or value, not both. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "in"
Section titled “"op": "in"”True when the field matches one of the listed values.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
array of string | number | boolean | yes | The values to match against. at least 1 item |
"op": "notIn"
Section titled “"op": "notIn"”True when the field matches none of the listed values.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
value |
array of string | number | boolean | yes | The values to match against. at least 1 item |
"op": "matches"
Section titled “"op": "matches"”True when the field matches the regular expression.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
pattern |
string | yes | JavaScript regular expression, tested against the value’s string form. Compiled when the config loads. min length 1 |
"op": "empty"
Section titled “"op": "empty"”True when the field is null, an empty string, or an empty list.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "notEmpty"
Section titled “"op": "notEmpty"”True when the field holds anything at all.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "exceedsFactor"
Section titled “"op": "exceedsFactor"”True when the field is more than factor times the comparand — a difference in magnitude rather than merely being larger. Defined only over non-negative magnitudes: a negative value, or a comparand of zero or less, does not fire.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
otherField |
string | yes | The input field this one is measured against. Required — this operator has no literal form. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
factor |
number | yes | The multiple to scale the comparand by. 3 reads as ‘three times’. A factor of 1 is legal and degenerates into a plain gt / lt. > 0 |
"op": "fallsBelowFactor"
Section titled “"op": "fallsBelowFactor"”True when the field is less than the comparand divided by factor. Defined only over non-negative magnitudes.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
otherField |
string | yes | The input field this one is measured against. Required — this operator has no literal form. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
factor |
number | yes | The multiple to scale the comparand by. 3 reads as ‘three times’. A factor of 1 is legal and degenerates into a plain gt / lt. > 0 |
"op": "sameDomain"
Section titled “"op": "sameDomain"”True when both values carry an email domain and the domains match, compared without regard to case. A value with no @ has no domain, so it never matches.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
otherField |
string | yes | The input field this one is measured against. Required — this operator has no literal form. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
ignore |
array of string | no | Domains that never count as shared, compared without regard to case — the large free providers, typically. Two accounts both at gmail.com have nothing in common worth colouring. |
"op": "sameLocalPart"
Section titled “"op": "sameLocalPart"”True when both values share a local part — the text before the @, or the whole value when there is no @ — compared without regard to case. That fallback is what lets a bare username be tested against a sender address.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
otherField |
string | yes | The input field this one is measured against. Required — this operator has no literal form. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
"op": "sharesPrefix"
Section titled “"op": "sharesPrefix"”True when both values begin with the same length characters, compared without regard to case. For spotting identifiers minted together — a run of handles all starting Bvd — where what matters is that two values resemble each other, not what either looks like alone. A value shorter than length never matches.
| Key | Type | Required | Notes |
|---|---|---|---|
field |
string | yes | The input field whose value is tested. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
otherField |
string | yes | The input field this one is measured against. Required — this operator has no literal form. min length 1, matches ^[A-Za-z0-9_-][A-Za-z0-9_ -]*[A-Za-z0-9_-]$|^[A-Za-z0-9_-]$ |
length |
integer | yes | How many leading characters must agree. Low values match by coincidence — 3 or 4 is usually where a shared prefix stops being an accident. > 0 |
"op": "allOf"
Section titled “"op": "allOf"”True when every listed condition holds. Conditions may nest.
| Key | Type | Required | Notes |
|---|---|---|---|
conditions |
array of Condition | yes | Every one of these must hold. at least 1 item |
"op": "anyOf"
Section titled “"op": "anyOf"”True when at least one listed condition holds. Conditions may nest.
| Key | Type | Required | Notes |
|---|---|---|---|
conditions |
array of Condition | yes | At least one of these must hold. at least 1 item |
"op": "not"
Section titled “"op": "not"”True when the nested condition does not hold.
| Key | Type | Required | Notes |
|---|---|---|---|
condition |
Condition | yes | The condition to negate. |