Skip to main content
Advanced variables allow you to capture, validate, and store highly structured information during a call using AI, even when the data must follow strict formatting rules. This feature is especially useful when accuracy matters and free-form text is not sufficient. In this guide, you’ll learn what advanced variables are, when to use them, and how to configure them correctly using a real-world example.

What Are Advanced Variables?

Advanced Variables extend Phonely’s standard variable system by allowing you to define exactly how a value should be formatted, validated, and stored. Like all variables in Phonely, they:
  • Capture information from the caller
  • Persist throughout the call
  • Can be reused in other blocks, integrations, and post-call actions
What makes advanced variables different is that they let you enforce structure using AI, even for complex or custom formats that traditional validation rules can’t easily handle.

Why Advanced Variables Matter

Some information cannot afford to be “close enough.” Examples include:
  • Vehicle Identification Numbers (VINs)
  • License or policy numbers
  • Dates in strict formats (e.g. YYYY-MM-DD)
  • Reference IDs required by downstream systems
  • Any value that must match a precise schema before being sent to an API or CRM
Without advanced variables, you would need extra prompts, cleanup logic, or manual validation downstream. With advanced variables, Phonely handles this automatically during the conversation.

Where to Use them

Advanced variables are configured inside your flow blocks (such as Talk, Ask Exactly, or Collect), within the Agent Design interface. They behave like any other variable in the system:
  • They can be referenced using @variable_name
  • They can be required or optional
  • They can be confirmed with the caller
  • They appear in post-call data, webhooks, and integrations
The difference lies in how the value is extracted and formatted.

Example: Capturing a VIN Number Correctly

Let’s walk through a common real-world use case: collecting a vehicle VIN. A VIN must:
  • Be exactly 17 characters
  • Contain only letters and numbers
  • Have no spaces or special characters
Be stored consistently every time Advanced Custom Variables Phonely This is a perfect use case for an advanced variable.
1

Create the Variable

In the block configuration:
  • Create a new variable (for example, vehicle_vin)
  • Choose the variable type as custom.
Even though a VIN is technically text, this is where advanced configuration becomes important.
2

Ask for the Information in the Prompt

Start by updating your prompt in the relevant block (for example, a Talk block) to ask for the information naturally.For example:
“Can you please provide the VIN number for your vehicle?”
At this stage, you are only guiding the conversation. The formatting logic comes next.
3

Define a Custom Format

This allows you to describe, in plain language, exactly how the value should look. Phonely’s AI uses this description to extract and normalize the value correctly from natural speech.For a VIN, your custom description might explain:
  • That the value is a 17-character alphanumeric identifier
  • That it should not contain spaces
  • That it should not include special characters
  • That only the raw VIN should be stored
You can also provide an example value so the AI has a clear reference for what a valid entry looks like.This step is essentially prompt-engineering for data extraction, but it’s built directly into the variable system.
4

Mark the Variable as Required (Optional)

If the flow cannot proceed without this information, you can mark the variable as required.When a variable is required:
  • The agent will not move forward until a valid value is captured
  • The AI will naturally guide the caller to provide usable input
  • The flow remains clean without extra conditional logic
5

Confirm the Value with the Caller

Advanced variables support automatic confirmation, which is highly recommended for sensitive or critical data.When confirmation is enabled:
  • The agent repeats the captured value back to the caller
  • The caller can approve or correct it
  • The variable is only finalized once confirmed
This adds an extra layer of reliability without requiring additional prompts or branching logic.

Using Advanced Variables Elsewhere in the Flow

Once captured, advanced variables behave exactly like any other variable in Phonely. You can:
  • Reference them in later prompts (@vehicle_vin)
  • Pass them into API Request blocks
  • Store them in CRMs or databases
  • Include them in post-call emails or summaries
  • Use them in routing or decision logic

When You Should Use Advanced Variables

Use advanced variables when:
  • Data must match a specific format
  • Downstream systems are strict about inputs
  • You want to avoid manual cleanup or retries
  • Accuracy matters more than flexibility
For simple conversational data, standard variables are often sufficient.