# Condition

The **Condition** component decides where a call goes by testing logical
expressions. Each expression can combine variables, constants, and functions to
check for a specific situation, and when an expression evaluates to true the
call is passed to the component wired to that branch. Reach for it when a call
flow needs to branch on a rule you can write out, for example the digit a caller
entered, whether the call arrived during business hours, or a value returned by
an earlier component. This page explains what the component does, how to set up
its branches, and which components a branch can lead to.

![The Condition component shown on the call flow canvas](/images/pbx/condition-component-cfd.png)

## Configure branches

Once you drop a **Condition** component onto the canvas, you build out its logic
by adding branches. Each branch pairs an expression with a destination, and a
built-in **No Match** branch handles calls that satisfy none of them.

### Add a branch for each condition

1. Click ![Add branch](/images/pbx/add-branch.png) on the component to create a
   new branch.

   :::note
   A single **Condition** component supports up to **10 branches**, and every
   branch must use its own distinct expression.
   :::

   ![Adding a new branch to the Condition component](/images/pbx/condition-add-branch.png)

2. Click the branch, enter its expression, then click **Confirm**.

   ![Entering an expression for a Condition branch](/images/pbx/condition-branch-expression.png)

   For instance, an expression of `FX_EQUAL($UserInput1.userInput,"1")` routes
   the call to the component attached to that branch whenever the caller presses
   `1`. Here `$UserInput1.userInput` is the value that a **User Input** component
   collected earlier in the flow, which is the usual way to branch on what a
   caller keyed in on their phone.

   :::note
   For the full list of variables and functions you can use when building an
   expression, see [Variables and Functions in Cloud Voice Expressions](/pbx/call-flow-designer-guide/constants-and-variables-in-cloud-voice-cfd-expression/).
   :::

### Set the No Match destination

Click ![Add branch](/images/pbx/add-branch.png) on the **No Match** branch to
attach a component. This component runs whenever a call fails to match any of
the conditions you defined.

:::tip
Always wire a component to **No Match**. It is the safety net for calls that
satisfy none of your branch expressions, so connecting it keeps those callers
moving through the flow instead of reaching a dead end.
:::

![Attaching a component to the No Match branch](/images/pbx/condition-invalid-input.png)

## Supported connections

Every **Condition** component includes the built-in **No Match** branch plus up
to 10 branches of your own. A branch can connect to exactly **one** downstream
component, chosen from the following.

| Component | Description |
|-----------|-------------|
| Prompt | Plays one or more audio prompts or a text-to-speech message to the caller. See [Prompt](/pbx/call-flow-designer-guide/prompt/). |
| Business Hours | Sends calls to different destinations depending on the time of day. See [Business Hours](/pbx/call-flow-designer-guide/business-hours/). |
| Menu | Offers callers a set of options and routes each call by the DTMF (Dual-Tone Multi-Frequency, the tone a phone sends when a key is pressed) digit the caller keys. See [Menu](/pbx/call-flow-designer-guide/menu/). |
| User Input | Collects DTMF digits from the caller, often paired with **Condition** to evaluate what was entered and branch accordingly. See [User Input](/pbx/call-flow-designer-guide/user-input/). |
| Language | Switches the system prompt language for the components that follow in the flow. See [Language](/pbx/call-flow-designer-guide/language/). |
| Record | Starts recording once the caller connects to another party, with optional prompts to announce recording at the start and while it runs. It can also turn recording off for calls that would otherwise be recorded. See [Record](/pbx/call-flow-designer-guide/record/). |
| Dial by Number | Lets callers dial a number directly to reach their destination. See [Dial by Number](/pbx/call-flow-designer-guide/dial-by-number/). |
| Dial by Name | An end component that closes the caller's path through the flow, letting them reach an extension user by keying the first three letters of that user's name. See [Dial by Name](/pbx/call-flow-designer-guide/dial-by-name/). |
| Transfer | An end component that hands the caller off to a chosen destination, with optional prompts to announce the transfer. See [Transfer](/pbx/call-flow-designer-guide/transfer/). |
| Hang Up Call | An end component that disconnects the call as soon as it is reached. See [Hang Up Call](/pbx/call-flow-designer-guide/hang-up-call/). |
| Condition | Branches calls by evaluating logical expressions. See [Condition](/pbx/call-flow-designer-guide/condition/). |
| Loop | Repeats a group of components, either a set number of times or until a condition is satisfied. See [Loop](/pbx/call-flow-designer-guide/loop/). |
| Internal Data Ops | Reads from and writes to the built-in PBX (Private Branch Exchange, your phone system) database. See [Get Extension Presence Status](/pbx/call-flow-designer-guide/get-extension-presence-status/), [Set Extension Presence Status](/pbx/call-flow-designer-guide/set-extension-presence-status/), [Get Queue Agent](/pbx/call-flow-designer-guide/get-queue-agent/), [Get Queue Info](/pbx/call-flow-designer-guide/get-queue-info/), [Get Agent Status](/pbx/call-flow-designer-guide/get-agent-status/), [Set Agent Status](/pbx/call-flow-designer-guide/set-agent-status/), [Get System Info](/pbx/call-flow-designer-guide/get-system-info/), [Get System Capacity](/pbx/call-flow-designer-guide/get-system-capacity/), [Get Extension Info](/pbx/call-flow-designer-guide/get-extension-info/), and [Get Company Contact Info](/pbx/call-flow-designer-guide/get-company-contact-info/). |
| Email Sender | Sends email from within the flow for real-time notifications, alerts, or user-specific details. See [Email Sender](/pbx/call-flow-designer-guide/email-sender/). |
| Database Access | Runs SQL (Structured Query Language) operations against a database mid-flow to retrieve or update data. See [Database Access](/pbx/call-flow-designer-guide/database-access/). |
| HTTP Request | Sends HTTP (Hypertext Transfer Protocol, the protocol web browsers and servers use to exchange data) requests to external web servers to exchange data with third-party services. See [HTTP Request](/pbx/call-flow-designer-guide/http-request/). |
