> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voicy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> Variables carry information through a call: values you pass in, details the caller gives, results from your systems and data pulled from the transcript afterwards.

## Kinds of variables

| Kind | Where it comes from | Defined in |
| - | - | - |
| **Provided** | Passed in before the call starts (for example on an outbound call), or a default value | Agent settings → Vars provided |
| **System** | Filled automatically at the start of every call | Built in |
| **Collected** ([flow agents](/guides/flow-agents)) | Collection nodes, Set Var, function responses and list nodes during the call | The flow |
| **Extracted** | Pulled from the transcript after the call ends. See [Extracted variables](/guides/variables#extracted-variables) | Agent settings → Vars extracted |

The system variables are `user_number` (the caller's number), `user_full_number` (the same number in international format), `agent_number`, `now` (current date and time, Israel time), `is_open` (whether you're inside operating hours, when they're enabled) and `direction` (inbound, outbound or web call).

## Using variables in text

Write `[var_name]` in a prompt, welcome message, announcement, [SMS](/guides/sms) text or function field, and Voicy replaces it with the value.

The easiest way is to type `[` and pick the variable from the menu that opens. The menu lists every variable available at that point, grouped by kind, for example **SYSTEM**. An arrow next to a variable opens its modifiers, so you can insert a ready-made reference such as `[user_number:local]`.

You can add these modifiers after the name:

* `[code:digits]` reads the value digit by digit, which suits codes and IDs.
* `[amount:spoken]` reads numbers as Hebrew words.
* `[phone:e164]` and `[phone:local]` format a phone number as `+972…` or `05…`. This is handy when your system expects one format.

## Collecting details with a Collection node

Each Collection node gathers up to 3 details. For each one you set:

* **Type**: Text, Number, Boolean, Phone, Email, License plate or Enum. Answers are checked against the type. Phone accepts Israeli mobile and landline numbers. License plate accepts Israeli vehicle plates: 7 or 8 digits, or a military (צ), police (מ), military police (מצ), diplomatic (CD) or consular (CC) plate. It is stored as digits, or as the letter, a dash and the digits (`צ-123456`), and a second variable `<name>_plate_type` records the kind (`civilian`, `military`, `police`, `military_police`, `diplomatic` or `consular`). An Enum only accepts one of its options.
* **Question**: the full question the agent asks, for example "What's your full name?"
* **Required**: the node won't move on until every required detail is collected. The caller can skip optional ones.

The agent confirms each detail briefly once it's captured. An Enum's options come from a type you create in the agent's **Types** section with **Add Type**, so several variables can reuse the same options.

## Setting and changing values

Use a **Set Var** node, or turn on **When condition fires, also set a variable** on a transition, to set or clear a value without asking the caller. Values can be expressions: arithmetic on numbers (<code style={{whiteSpace: "nowrap"}}>{'[count] + 1'}</code>) or text that combines variables.

## Branching on values

A **Logic Split** node compares variables and routes instantly, for example <code style={{whiteSpace: "nowrap"}}>{'[status] == "vip"'}</code>. Conditions support comparisons (`== != < <= > >=`) and `&&`, `||`, `!`. The first match wins, and a branch with no condition catches everything else.

## Default values

Each variable under **Vars provided** can have a **Default value**. The agent uses it whenever the call doesn't bring its own value, for example on every inbound call, or on an outbound call that doesn't pass that variable.

When a call starts, values are filled in this order. A later step replaces an earlier one:

| Order | Source | Applies to |
| - | - | - |
| 1 | System variables, filled automatically | Every call |
| 2 | The **Default value** of each variable under Vars provided | Every call |
| 3 | Values passed in when the call is placed: `vars_provided` in the API, or the values you enter for a Phone Call test | Outbound calls |
| 4 | Your test values for system variables | Your own browser tests only |

System variables have no default value of their own: the dialog shows what they contain, but only a test value can change them.

## Passing variables into an outbound call

When you start a call with the `call-dial` API, send values in `vars_provided`, for example `{"customer_name": "Dana"}`. Declare each one under **Vars provided** first. Declared variables are your agent's **variable contract**: the API returns them in the agent's `variables_provided` with name, description and type. A variable that isn't passed uses its [default value](/guides/variables#default-values).

## Extracted variables

Extracted variables are filled **after the call**, from the whole transcript. Use them for reporting fields, like the reason for calling or whether the caller asked for a callback. For anything the call itself needs while it's running, use collected variables instead.

<Steps>
  <Step title="Open Vars extracted">
    In the agent editor, open **Properties** and expand **Vars extracted**.
  </Step>

  <Step title="Add a field">
    Add each field you want pulled from every call, such as `customer_name`, `reason_for_call` or `callback_requested`. Give it a name (lowercase letters and underscores) and a type: text, number, boolean, phone, email or license plate.
  </Step>

  <Step title="Describe it">
    Write a clear description of what the field should hold. Clear names and descriptions give better results.
  </Step>
</Steps>

The values appear on the call's detail page, in your call-ended [webhook](/webhooks) and in the call-get API. See Call summary and extracted variables.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.