Dynamic variables
Give the agent different details on every call, such as the caller's name, address or order number, from the API, a bulk call CSV or the dashboard.
Dynamic variables are details that change from call to call: the person's name, their address, an order number, a due amount. You pass them in when the call starts, and the agent uses them during the call.
Define the variables on the agent
- Open your agent and click the
{ }button at the top (Custom dynamic variables). The number shows how many you have. - Click Add Variable. Enter a Variable Name, such as
address, and a Variable Value, such as "201, West Street". - Click Save Variables.
The value you save here is a sample. Test calls you place from the dashboard on an outgoing agent use it. On real calls, the value comes from the call itself (see below).
Use them in the agent
- In the prompt and welcome message: write the name in double braces,
such as
Hello {{customer_name}}, I'm calling about your order {{order_id}}.The welcome message is filled in before it is spoken. - Everything passed with a call is also given to the agent as details about this caller, so it can use them in the conversation even where you did not write a placeholder.
- As a transfer number: in Transfer and routing, switch a transfer number to Dynamic and pick the variable that holds the number. See Call settings.
phone_number is filled in for you with the customer's number (the person
called, or the person calling in), unless you pass your own.
Pass the values on each call
Bulk call (CSV)
Add one column per variable to your CSV. Each row is one contact, so every contact gets its own values.
phone_number,customer_name,address
+15551234567,Demo User,"201, West Street"
+15557654321,Sam Lee,"14 Park Road"phone_numberis required, with the country code.- Name each column exactly like the variable, for example
customer_namefor{{customer_name}}. A name with spaces, such asCompany Name, works too.
See Bulk calls.
API (Dispatch call)
Send the values in call_context when you start the call:
{
"agent_id": 123,
"to_number": "+15551234567",
"call_context": {
"customer_name": "Demo User",
"address": "201, West Street"
}
}See Dispatch call. Contacts
added to a bulk call over the API carry them in custom_variables; see
Bulk calls over the API.
Good to know
- Variables are information, not instructions. If a value looks like a command, the agent ignores it.
- A placeholder with no value is left as it is, so pass every variable your welcome message uses.
- Keep names simple and consistent: lowercase with underscores, the same in the agent, the CSV and the API.
Was this page helpful?
Call settings
Every call setting on an agent, what it does on a call, its default and when to change it. Silence handling, end call rules, transfers, filler phrases, ringing, ambient sound, dynamic variables and speech detection.
Per-call languages
Set the languages an agent speaks on one specific call, chosen at dial time, without changing the agent's own configuration.
