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

# Dynamic Variables & Personalization

> Personalize AI voice conversations using dynamic variables (such as name, company, and amount due) and custom CSV parameters.

Dynamic variables allow your AI voice bot to speak with personalized, customer-specific information on every call — such as customer names, account balances, appointment dates, or company names.

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/hgr1uCxs6nc" title="How to Pass Dynamic Variables to AI Voice Agents" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

***

## How Dynamic Variables Work

In your bot's **Greeting** or **System Prompt**, write any variable inside double curly braces: `{{variable_name}}`.

When a call is initiated, Trikon Voice automatically replaces the placeholder with the real value for that contact before the bot starts speaking.

### Example in Greeting Message

```text theme={null}
Hello {{name}}, this is Sarah calling from {{company}}. I'm reaching out regarding your appointment scheduled for {{appointment_time}}. Does this time still work for you?
```

### Example in System Instructions

```text theme={null}
You are an account manager for {{company}}. 
The caller's name is {{name}}. 
Their outstanding invoice balance is {{amount_due}}, due on {{due_date}}.
If they confirm they want to pay today, offer a 5% instant discount of {{discounted_amount}}.
```

***

## Types of Dynamic Variables

Trikon Voice supports two types of dynamic variables in campaigns:

<CardGroup cols={2}>
  <Card title="Contact-Level Variables" icon="users">
    Unique values for each individual person, imported directly from columns in your uploaded CSV file (e.g. `amount_due`, `patient_name`).
  </Card>

  <Card title="Campaign-Level Variables" icon="sliders">
    Constants that apply to every person in the campaign, configured once in the campaign builder (e.g. `discount_code`, `event_venue`).
  </Card>
</CardGroup>

***

## 1. Contact-Level Variables (CSV Upload)

When creating an outbound campaign, any column header in your CSV file automatically becomes an available dynamic variable.

### Preparing your CSV

Your CSV file must include a `phone` column. Any additional column becomes a variable:

```csv theme={null}
phone,name,company,amount_due,due_date
+919845012345,Asha,Acme Dental,4500,October 15
+919845012346,Ravi,Apex Logistics,12000,October 18
+919845012347,Priya,Zenith Tech,8500,October 22
```

In the example above, the following variables will automatically be injected for each contact:

* `{{name}}`
* `{{company}}`
* `{{amount_due}}`
* `{{due_date}}`

<Tip>
  Use lowercase letters and underscores for column headers (e.g. `order_id`, `invoice_num`, `patient_name`). Trikon Voice maps headers cleanly to `{{order_id}}`.
</Tip>

***

## 2. Campaign-Level Constants

If a value is the same for every contact in a campaign — such as an offer code, webinar link, or branch location — you do not need to repeat it in every row of your CSV.

In the **Create Outbound Campaign** screen:

1. Scroll to **Campaign Settings**.
2. Add custom key-value pairs under **Campaign Constants** (e.g. `offer_code = FESTIVE20`, `event_date = Saturday at 6 PM`).
3. Use `{{offer_code}}` and `{{event_date}}` directly in your prompt or greeting.

***

## 3. Testing Dynamic Variables in the Playground

Before running a real phone campaign, you can test how your AI agent handles dynamic variables directly in the **Voice Studio**:

1. Open **Voice Studio** or **Agent Settings**.
2. In the **Telephony Tester / Playground** card (bottom right), enter a test **Customer Name** or preview variables.
3. Start the test call to hear the bot speak the variable aloud in real time.

***

## 4. Passing Variables via API

If you trigger outbound calls programmatically via the Trikon Voice API, pass dynamic variables inside the `metadata` object of the call request:

```bash theme={null}
curl -X POST https://api.trikon.tech/api/calls/dispatch \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+919845012345",
    "agentId": "agent_clx123abc",
    "metadata": {
      "name": "Asha Sharma",
      "company": "Acme Dental",
      "amount_due": "₹4,500",
      "due_date": "October 15th"
    }
  }'
```

The AI agent will seamlessly inject `{{name}}`, `{{company}}`, and `{{amount_due}}` into its speech context.

***

## Best Practices & Guardrails

<AccordionGroup>
  <Accordion title="Provide fallback instructions in your prompt">
    If a contact might not have a value for a specific field (e.g. a missing name), instruct your bot in the prompt:

    ```text theme={null}
    If {{name}} is not provided or empty, greet the caller with 'Hello, good afternoon!' without asking for their name immediately.
    ```
  </Accordion>

  <Accordion title="Format currency and dates clearly">
    Write numbers and dates in a way that sounds natural when spoken aloud:

    * Instead of `15/10/2026`, write `October 15th`.
    * Instead of `4500`, write `4,500 rupees` or `$45`.
  </Accordion>

  <Accordion title="Match variable names exactly">
    Variables are case-insensitive, but avoid spaces or special characters in column names. Use `order_number` instead of `Order #`.
  </Accordion>
</AccordionGroup>
