Using Variables
A variable is a named field that stores information collected during a conversation—such as an end-user’s name, email, order number, or preferred language. Ada uses variables to capture user inputs, track conversation context, and store metadata throughout an interaction. They enable personalization, guide conversation flow, support conditional logic and integrations, and pass data to backend systems for reporting and further processing.
Each variable can store up to 100,000 characters. When saving large payloads (such as full API responses), be mindful of this limit, as exceeding it may result in parsing issues or unexpected behavior.
Variable types
Variables come in several types, each designed for a different purpose. This section explains how each type works, when to use it, and how the values are captured or provided during a conversation.
Autocapture variables
Autocapture variables are automatically populated by scanning the conversation transcript for information that matches the variable’s description. If the information is not found, Ada generates a real-time question to collect the value and then extracts it from the updated transcript.
Autocapture variables:
- Rely on transcript parsing, not raw user messages
- Use LLM-based extraction
- Do not consider structured UI inputs such as button selections
Limitations
While Autocapture variables are powerful, there are a few limitations to keep in mind:
-
Language support: Autocapture is designed to perform best in English. This feature does not work at all in most other languages. While there may be limited success with some languages like Spanish, it generally fails to extract or generate questions accurately in languages such as German or Chinese.
Currently, there’s no way to prevent Autocapture variables from executing if the language used isn’t English, so results might be unexpected. -
Context-sensitive performance: The accuracy of value capture depends on the clarity of the variable’s description and how well the customer communicates the required information.
Autocapture behavior
When you create an Autocapture variable, you must choose its capture behavior. This setting defines how the Agent collects and updates the variable’s value during a conversation, including when it decides to prompt the user for additional information.
- Ask when needed: The AI Agent attempts to extract the value from the transcript. If no suitable value is found, Ada asks the user a question and then extracts the value from their reply in context.
- Always ask: The Agent asks the user for the variable’s value every time the block that references it runs, even if a value already exists.
Metavariables
Metavariables are end user–specific fields that Ada collects automatically. They can include browser details, location metadata, channel-specific values, conversation context, system indicators, and more.
Metavariables are:
- Automatically populated
- Read-only
- Available for use in Processes, Playbooks Actions, and other supported features
Unlike Autocapture, Global, and Sensitive variables, metavariables cannot be created manually. They are collected automatically by Ada or passed into the Agent through setMetaFields() in your embed script.
Metavariable definitions
The following metavariables are automatically collected and available for use:
Browser & device information
browser: Browser family name extracted from user-agent string (e.g.,chrome,firefox,safari)device: Platform/OS name parsed from user-agent string (e.g.,macos,windows,android,iphone)browser_version: Browser version string extracted from user-agent using regex matchinguser_agent: Complete browser user-agent string from HTTP request headers
Location & network
ip_address: Client’s IP address (only when IP tracking is enabled in privacy settings)client_gmt_offset: Client’s timezone offset (only when timezone tracking feature is enabled)language: User’s language in BCP 47 format, validated against your bot’s supported languages
Conversation context
last_question_asked: Text content of the most recent text message sent by the user/chatterlast_answer_id: ID of the last response/answer displayed to the end user (only when personalization feature is enabled)
Frontend state
introshown: Boolean indicating if introductory campaign message was displayed (sent by chat frontend)initialurl: URL where the chat widget was initially loaded (sent by chat frontend)
CSAT & feedback
csat_score: Customer satisfaction score from survey responses (only when CSAT feature is enabled)csat_positive: Boolean indicating if CSAT score represents positive feedback (only when CSAT feature is enabled)
Channel-specific
sunshine_facebook_page_id: Facebook page ID for Sunshine Conversations integration (only when Sunshine channel is enabled)
Email channel
email_attachments: List of email attachments in email channel conversationsemail_has_attachments: Boolean indicating if email conversation contains attachmentsada_email_subject: Subject line of email in email channel conversationsada_email_origin: Origin information for email channel conversationsemail_attachment_is_signature: Boolean indicating if email attachment is a signature
Authentication & integration
jwt_name: Name from JWT token (part of Zendesk Glass integration)jwt_email: Email from JWT token (part of Zendesk Glass integration)zdsession: Zendesk session information for integrations
System state
created: System-generated variable for conversation creation contextgreeting: System-generated variable for greeting contextprivate: System-generated variable for private conversation contextreset: System-generated variable for conversation reset contextembed: System-generated variable for embedded chat contexthas_multiple_participants: Boolean indicating if conversation has multiple participants
Testing & development
test_user: Boolean flag indicating if conversation was initiated from dashboard with test_user=1 parameterguidance_id: ID used for testing guidance features in webchatprocess_id: ID used for testing process flows in webchatplaybook_id: ID used for testing playbook functionality in webchat
Global variables
Global variables persist throughout your AI Agent’s interactions and remain available for reuse. Their values reset when a new conversation begins. Global variables must be created manually—Ada does not automatically detect or capture them. This also applies to sensitive variables.
Sensitive variables
Sensitive variables store confidential information and must be defined manually, as Ada does not automatically detect or capture them. Their values:
- Are redacted in the dashboard
- Are automatically deleted after 24 hours
- Are not retained beyond that window
Use sensitive variables for information that should not persist for long-term analysis or reuse.
Creating and using variables
Before you can reference a variable in your Agent, you must create it and define its behavior. This section describes how to configure variables and how to populate them during a conversation.
Create a variable
To create a new variable, use the Variable Manager to define its name, description, and type. The steps below walk you through the process.
To create a new variable:
- In the Ada Dashboard, navigate to AI Agent profile > Variables.
- Click New variable.
- Enter a name and a description.
- Choose a variable type: Autocapture, Global, or Sensitive.
Metavariables cannot be created manually. They are automatically collected by Ada or passed via
setMetaFieldsin your embed script. - For Autocapture variables, select a capture behavior (Ask when needed or Always ask).
Use variables in your AI Agent
Once in place, variables can be referenced throughout your AI Agent to personalize content, guide logic, and pass data into Actions, Greetings, Playbooks, and other areas where variable-based customization is supported.
Ways to populate variables
Variables can be filled in several ways depending on where the data comes from and how you intend to use it. Use this table to choose the method that best fits your use case:
Capture block
Prompts the user for input and stores the response in a variable.
Use this when:
- You need explicit information from the user
- The information cannot be inferred automatically
Set Variable block
Assigns or updates values internally without user interaction.
Use this when:
- You want to set default values
- You want to transform or manipulate existing values
- You need to manage internal state, counters, or flags
HTTP Request block
Fetches data from an external API and stores parts of the response in variables.
Use this when:
- Data lives in your backend or a third-party system
- You need dynamic values such as account details, prices, or statuses
Metadata via embed script
Passes contextual data from your app or website into Ada as custom metavariables.
Common examples include:
- Logged-in user name
- Email or account ID
- Subscription tier or support plan