Logic and validation
Operators
Every condition you can use in display logic, validation rules and automation conditions, and which fields each one suits.
Operators are the comparisons in a condition, such as Is, Contains or Is more than. The same set is used by conditional logic, validation rules and conditions in automations, such as an If step. The builder only lists the operators that suit the value you picked.
All operators
Validation rules phrase each operator as a requirement, so the label differs slightly from display logic and automations.
| Display logic and automations | Validation | Needs a value |
|---|---|---|
| Is | Must equal | Yes |
| Is not | Must not equal | Yes |
| Is more than | Must be greater than | Yes |
| Is at least | Must be greater or equal to | Yes |
| Is less than | Must be less than | Yes |
| Is at most | Must be less or equal to | Yes |
| Length is | Must have length | Yes |
| Length is not | Must not have length | Yes |
| Length is more than | Must exceed length | Yes |
| Length is at least | Must exceed or equal length | Yes |
| Length is less than | Must be less than length | Yes |
| Length is at most | Must be less or equal to length | Yes |
| Contains | Must contain | Yes |
| Does not contain | Must not contain | Yes |
| Starts with | Must start with | Yes |
| Ends with | Must end with | Yes |
| Matches pattern | Must match a pattern (regular expression) | Yes |
| Is an email address | Must be valid email | No |
| Is a web address | Must be valid URL | No |
| Is a number | Must be number | No |
| Is a whole number | Must be integer | No |
| Is a decimal number | Must be decimal number | No |
| Is letters only | Must be alphabetic | No |
| Is letters and numbers | Must be alphanumeric | No |
| Is true | Must be true | No |
| Is false | Must be false | No |
| Is empty | Must be empty | No |
| Is not empty | Must not be empty | No |
In the condition menu they are grouped as Is or is not, More or less, Length, Text, Kind of value, Yes or no and Filled in or not.
When an operator needs a value, you can type one or pick another answer or data table value.
Operators by field
| Fields | Operators offered |
|---|---|
| Text, Long text, Email, URL, Phone, Password, Signature, Hidden value, Dropdown, Single choice, Country, Team member, and the parts of Name and Address | Is, Is not, the length operators, Contains, Does not contain, Starts with, Ends with, Matches pattern, the kind of value checks, Is empty, Is not empty |
| Number, Slider, Rating | Is, Is not, Is more than, Is at least, Is less than, Is at most, Is empty, Is not empty |
| Yes or no | Is, Is not, Is true, Is false, Is empty, Is not empty |
| Date, Time, Date and time | Is, Is not, Is empty, Is not empty |
| Multiple choice, File upload | The length operators, Contains, Does not contain, Is empty, Is not empty |
| A repeating field or group, as a whole | The length operators, Is empty, Is not empty |
To compare the answers inside a repeating group, pick a field in it rather than the group.
When the type of a value isn’t known in advance, such as the result of an automation step, every operator is listed. Pick one that suits the value you expect.
The condition menu also lists Is more than, Is at least, Is less than and Is at most for date and time fields, but these comparisons don’t work for dates and times yet. To limit which dates or times can be chosen, use the field’s minimum and maximum settings. See Field settings.
How the operators compare
Is and Is not
- Text comparisons are exact and case-sensitive: “London” is not “london”.
- Numbers compare by value, so
10is10.0. - For Dropdown and Single choice, compare with the option’s value, not its label. Country answers are two-letter codes such as
GB.
More or less
These compare numbers. Is at least includes the value itself; Is more than doesn’t.
Length
- For text, the length is the number of characters. “café” has four.
- For Multiple choice, it is the number of options chosen. For File upload, the number of files.
- For a repeating field or group, it is the number of items.
- An empty answer has a length of 0.
Text
- Contains, Starts with and Ends with are case-sensitive.
- For Multiple choice, Contains checks whether a particular option was chosen. Use the option’s value.
- Matches pattern takes a regular expression in RE2 syntax. It can match anywhere in the answer unless you add
^at the start and$at the end.
Kind of value
These check what text looks like:
| Operator | Passes for |
|---|---|
| Is an email address | Letters A to Z, digits and . _ % + - before the @, then a domain with a dot and an ending of two or more letters |
| Is a web address | Text starting with http://, https:// or ftp://, with no spaces |
| Is a number | A whole or decimal number, such as 42 or -3.5, with no spaces or thousands separators |
| Is a whole number | A number with no decimal point, such as 42 |
| Is a decimal number | A number written with a decimal point, such as 3.5 |
| Is letters only | Only the letters A to Z, in either case. Spaces, accents and hyphens fail. |
| Is letters and numbers | Only the letters A to Z and digits 0 to 9 |
Is an email address is stricter than the Email field’s own check, which accepts any address like name@example.com.
Yes or no
Is true and Is false check a Yes or no answer.
Filled in or not
Is empty passes for an unanswered question, empty text and a list with nothing in it. A number 0 and a Yes or no answer of no are not empty.
Unanswered questions
When the value being checked has no answer, a condition passes only for:
- Is empty
- Is not, when compared with a value
- the length operators, which treat it as length 0
Everything else, including Does not contain, fails. For example, “Notes Does not contain urgent” doesn’t match until something is written in Notes. Add an Is not empty rule, or use Is empty, when you need to handle unanswered questions explicitly.
In validation, rules don’t run on an optional field left empty. See Validation.
Change operators in automations
Automations started by Answer changes while filling in, Answers are changed or Team field changes have three more operators, grouped under Change:
| Operator | Passes when |
|---|---|
| Changed | The value is different from before the save |
| Changed to | The value changed, and is now the value you give |
| Changed from | The value changed, and used to be the value you give |
See Triggers.