# Conditions

> The operators a condition can use, how groups of conditions join, and the blank rule that decides where a lead with missing data goes.

A condition tests one field: a **field**, an **operator** and a **value**. For example, `sopro.headcount` is less than `11`.

If / else and Branch steps route by conditions. A Score step uses them to add points.

## Operators

| Operator | Holds when | If the field is blank |
|---|---|---|
| is | The field is the value | Does not hold |
| is not | The field is not the value | Holds |
| is any of | The field is one of the values in the list | Does not hold |
| is not any of | The field is none of the values in the list | Holds |
| is less than | The field is a number below the value | Does not hold |
| is more than | The field is a number above the value | Does not hold |
| is blank | The field is blank | Holds |
| is not blank | The field has a value | Does not hold |
| contains | The field holds the value somewhere in it | Does not hold |
| starts with | The field starts with the value | Does not hold |
| ends with | The field ends with the value | Does not hold |
| domain matches | The field's domain is one of the domains in the list | Does not hold |

"is blank" and "is not blank" take no value.

## How values are compared

- **Text ignores case.** `Acme` is `acme`.
- **Spaces at either end are dropped** from the field and from the value.
- **A list is separated by commas:** `UK, Ireland, France`.
- **Numbers** may hold a thousands comma, a decimal point or a percent sign. `1,200`, `38.5` and `12%` are numbers. `201-500` is not, so test a band with "is" or "is any of", or test `sopro.headcount`, which is a number.
- **A number test on something that is not a number does not hold.**
- **"contains", "starts with" and "ends with" need a value.** With an empty value they do not hold.
- **"domain matches" reduces both sides to the main domain.** `https://www.acme.com/pricing` matches `acme.com`. The value may be a list of domains.

## The blank rule

A blank field makes every positive test false, and makes "is not" and "is not any of" true.

This matters most when a company is not found. Every `sopro.` field is then blank, so the lead falls through each positive test to the last exit. Decide what that exit does. "Is not" tests need the same care: `sopro.country` is not `UK` holds for a lead with no country at all.

To treat missing data on its own, test for it first: `sopro.matched` is `no`, or the field "is blank".

## Groups: all or any

Conditions sit in a group. The group holds when **all** of its conditions hold, or when **any** of them does. You choose which.

A group with no conditions never holds.

## If / else and Branch

- **If / else** has one group. The lead takes **Yes** when it holds, and **No** when it does not.
- **Branch** has several groups, each with a name and its own exit. They are tried in order. The lead takes the exit of the first that holds. If none holds, it takes **Else**.

Order the branches of a Branch step from the most specific to the least.

## In the trace

A lead's trace shows each group that was tried, each condition in it and whether it held. That is how you, or an agent, can say why a lead went where it did.
