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.

To learn how Ada identifies users and how session behavior affects data reuse, see Conversation identifiers and persistence.

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.
Autocapture behavior is influenced by conversation continuity. To understand when conversation and user identifiers are reused or reset, which can affect the transcript available to Autocapture, see Conversation identifiers and persistence.

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:

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: 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 matching
  • user_agent: Complete browser user-agent string from HTTP request headers
  • 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
  • last_question_asked: Text content of the most recent text message sent by the user/chatter
  • last_answer_id: ID of the last response/answer displayed to the end user (only when personalization feature is enabled)
  • 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_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)
  • sunshine_facebook_page_id: Facebook page ID for Sunshine Conversations integration (only when Sunshine channel is enabled)
  • email_attachments: List of email attachments in email channel conversations
  • email_has_attachments: Boolean indicating if email conversation contains attachments
  • ada_email_subject: Subject line of email in email channel conversations
  • ada_email_origin: Origin information for email channel conversations
  • email_attachment_is_signature: Boolean indicating if email attachment is a signature
  • 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
  • created: System-generated variable for conversation creation context
  • greeting: System-generated variable for greeting context
  • private: System-generated variable for private conversation context
  • reset: System-generated variable for conversation reset context
  • embed: System-generated variable for embedded chat context
  • has_multiple_participants: Boolean indicating if conversation has multiple participants
  • test_user: Boolean flag indicating if conversation was initiated from dashboard with test_user=1 parameter
  • guidance_id: ID used for testing guidance features in webchat
  • process_id: ID used for testing process flows in webchat
  • playbook_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:

  1. In the Ada Dashboard, navigate to AI Agent profile > Variables.
  2. Click New variable.
  3. Enter a name and a description.
  4. Choose a variable type: Autocapture, Global, or Sensitive.
    Metavariables cannot be created manually. They are automatically collected by Ada or passed via setMetaFields in your embed script.
  5. 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:

MethodUse whenExample
CaptureYou need explicit user inputAsk for an order number
Set VariableYou need internal state or transformsIncrement a retry counter
HTTP RequestData comes from an external systemFetch current subscription status
MetadataData comes from your own applicationPass the logged-in user’s account ID

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

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

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
Be mindful of the 100,000-character limit when storing large payloads.

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

See also