> For the complete documentation index, see [llms.txt](https://v5docs.keyfax.biz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v5docs.keyfax.biz/reference/expression-reference/logical-expressions.md).

# Logical expressions

Expressions that produce a true or false answer, or choose between two values. Use them to drive a condition in a script.

| Expression        | Databox value            | Result  | Notes                                                           |
| ----------------- | ------------------------ | ------- | --------------------------------------------------------------- |
| `If("Yes", "No")` | `true` / `True` / `TRUE` | `Yes`   | The databox value must be a boolean. Anything else is an error. |
| `If("Yes", "No")` | `false`                  | `No`    |                                                                 |
| `Exists`          | `any text`               | `True`  | See Exists.                                                     |
| `Exists`          | (empty)                  | `False` | `False` is returned only for an empty value.                    |

`If` takes the condition from the databox value, then the value to use when it is true and the value to use when it is false. The two results do not have to be text — they can be numbers or dates.

Combine conditions with `AND`, `OR` and `NOT`. See [Operators and literals](/reference/expression-reference/operators-and-literals.md).
