Skip to main content
Variables cover
Variables cover

Introduction

Variables are placeholders that hold data during a conversation. They hold information such as:
  • Customer data: details you know before the conversation, from your CRM, a lead file, or an API (e.g. a name, a membership level).
  • Collected answers: details Pearl gathers from the customer during the conversation (e.g. a preferred day, an email address).
  • Call results: details produced once the conversation ends (e.g. the summary, the transcript).
  • Fixed settings: values that stay the same for a whole version of your Pearl (e.g. an API base URL).
Why Are Variables Important?
  • Personalize Interactions: Tailor conversations to each customer.
  • Control Conversation Flow: Branch the conversation based on what you know or what Pearl collected.
  • Store and Reuse Information: Keep track of data throughout the conversation for consistency.
  • Integrate with External Systems: Send collected data to your tools, and pull data from them.
  • Enhance Actions: Use variables in actions like personalized emails, SMS, or API requests.

Variable Manager Overview

Variables are managed in the Variables & credentials dialog of the Pearl editor, shared by the whole Pearl. Its Variables section lists every variable with its Name, its ID, and its group; Credentials holds the keys your API requests sign in with (see API node).
Variables section of the Variables & credentials dialog
Variables section of the Variables & credentials dialog
Variables belong to one of four groups, each with its own colour in the editor:
Post-call variables are predefined by the platform: they can’t be created or modified, and they’re available only in Post-Call Actions, to send structured data (summaries, recordings) to your tools after the conversation.
Some variables are built in: they’re listed first with a lock, set by the platform on every call. You can use them, not edit or delete them.
Agent Phone Number (agentPhoneNumber) contains the Pearl’s own phone line for the current conversation, unlike Phone Number, which identifies the customer. It is empty on channels without a phone number, including Telegram and browser Test Chat. An API node that requires it as an input doesn’t run while it’s empty.

Accessing the Variable Manager

1

From the editor header

Click the { } button (Variables & credentials) in the header of the Pearl editor.
Variables & credentials button in the Pearl editor header
Variables & credentials button in the Pearl editor header
2

From a field

In any field that accepts variables, click Variable (or the { } button) to open the list of variables, grouped by Pre-call, Collected in-call, Post-call, Credentials, and Environment, with a search. Pick one to insert it, or click Manage Variables at the bottom to open the dialog.
List of variables opened from a field, with Manage Variables at the bottom
List of variables opened from a field, with Manage Variables at the bottom

Creating and Managing Variables

1

Add a variable

In the Variables section, click Add variable, then pick its group at the top of the form: Pre-call, In-call, or Environment.
2

Fill in the variable details

Form of a new in-call variable with its type, name, ID and description
Form of a new in-call variable with its type, name, ID and description
Display name vs ID: the Display name is what you read and what Pearl says; the ID is the key the system uses everywhere else. When importing leads or calling the API, the column header or callData key must match the variable’s ID, not its Display name.
Variable Types
3

Set the options (optional)

  • Allow multiple entries: store a list of values of the chosen type, e.g. children’s ages [6, 10, 14].
  • Reset every interaction: start the variable empty in every new interaction instead of reusing the value from a previous one.
Allow multiple entries and Reset every interaction switches of a variable
Allow multiple entries and Reset every interaction switches of a variable
Reset every interaction variables are never filled from lead files or the API: they’re left out of the lead template, and values sent for them are ignored.
4

Define allowed values (optional)

In Allowed values, list the accepted values, each with an optional Code sent to your systems instead of the value. Type in the empty row to add another one.
Allowed values of a variable, each with a code
Allowed values of a variable, each with a code
This is ideal for structured answers (e.g. Issue Type, Region). Pearl only picks from the list, and when a value has a code, the code is what’s stored.
5

Save the variable

Click Add variable. It’s now available in every field of your flow that supports variables.
Some fields, like the Opening Sentence, accept only Pre-call and Environment variables.
Environment variables An environment variable holds a fixed value of the Pearl version, such as an API base URL or an account ID. It has only a Display name, an ID, and a Value (required, up to 500 characters, and it can’t contain another variable). Before each call, the platform replaces the variable everywhere in the flow with its value: scripts, prompts, API URLs and headers, messages. Use one to change a value in a single place instead of in every node.
Form of a new environment variable with its name, ID and value
Form of a new environment variable with its name, ID and value
Environment variables can’t receive an API response and aren’t part of lead files. When you paste a version from another Pearl, this Pearl keeps its own values.
Find, edit, and delete variables
  • Search: type a name or an ID in Search variables, or filter the list by group with Type.
  • Edit: click a variable’s row to open its form, change it, then click Save. Built-in variables can’t be opened.
  • Delete: tick one or more rows, then click Delete in the bar that appears; or open a variable and choose Delete variable in its … menu. Nodes, actions, and prompts that use a deleted variable lose its value.
Two variables ticked, with the Delete bar
Two variables ticked, with the Delete bar

Using Variables in Conversations

Insert a variable in any field that supports them with the Variable button: a node’s script, an SMS or email, an API URL or body, a transition. It shows as a coloured chip in the field, and Pearl replaces it with its value during the conversation.

Example

In a Dialogue node’s script: “Hi {firstName}, which day works best for you?” Pearl says “Hi Jane, which day works best for you?”.
How in-call variables are filled: Pearl collects them during the conversation, guided by each variable’s Description: describe what it holds and when to fill it. A new value replaces the previous one. Once the conversation ends, a pre-call or in-call variable that is still empty is filled from the transcript when possible.

Example in an SMS Node

In an SMS node’s SMS Content: Hi {firstName}, your appointment on {preferredDay} is confirmed. The SMS is sent with the values Pearl has at that moment.

Example in a Post-Call Email

In a post-call email, combine call results with collected data: Summary of your call with {firstName}: {post_call_summary}.

Implementing Conditional Logic with Variables

Each transition of a node is a condition written in plain language, and it can mention variables. Pearl reads the condition and decides which transition to follow, based on the conversation and the variables’ values.
Transitions of a node, the first one mentioning the First Name variable
Transitions of a node, the first one mentioning the First Name variable

Example

A survey node with two transitions:
  • “{satisfactionScore} is 4 or 5” → a node thanking the customer.
  • “{satisfactionScore} is 3 or less” → a node asking how to improve.

Populating Variables from External Data

Pre-call variables can be filled before the conversation, from a lead file, the API, or the call itself.
1

Open the Leads tab

On your Pearl’s page, open the Leads tab (shown when outbound calling is on) and click Add lead.
2

Upload a file

In Upload files, download the template your Pearl generates (CSV template or XLSX template), fill in your leads, and upload it back. The template holds only the variables your flow uses; keep its columns as they are.
Add lead panel with the CSV and XLSX templates and the upload zone
Add lead panel with the CSV and XLSX templates and the upload zone
3

Or add a lead manually

In Manually, enter the Phone number, then a value for each variable, the Timezone, and an optional Reference ID.
Add lead panel in Manually mode with one field per variable
Add lead panel in Manually mode with one field per variable

Example CSV Entry

Country Code and Phone Number are required; Reference ID is optional. Every other column header must match a variable’s ID exactly, including the case.
A value sent for a variable, through a lead file or the API, can be up to 200 characters.

Adding Variables via API
  1. Use the Add Lead API Endpoint: PUT /v1/Outbound/{outboundId}/Lead.
  2. Include Variables in the callData field of your JSON payload.

Example Request


Sending Variables in Single On-Demand Calls
  1. Use the Make Call API Endpoint: POST /v1/Outbound/{outboundId}/Call.
  2. Include Variables in the callData field of your JSON payload.

Example Request


Passing Data on Inbound Calls with Custom SIP Headers

External data can be passed to a Pearl on inbound calls using custom SIP headers. Include the values on the INVITE with an X- prefix (for example X-CustomerId), then create a Pre-call variable whose ID matches the header name exactly, including the prefix. The values are mapped to those variables on each call and are available to the agent and the workflow.
This option is available only for numbers connected through Custom VoIP. Type the ID by hand: the Display name can’t contain a -.

Example

Your SIP trunk sends this header on the INVITE:
Create a Pre-call variable with the ID X-CustomerId. On each call, it holds the value sent in the header, and you can use it like any other variable, for example {X-CustomerId} in a script or in an API request.

Addressing the Caller by Gender (Hebrew Calls)

In Hebrew, the second person changes with the gender of the person addressed. On Hebrew voice calls, Pearl adapts what it says to the caller’s gender. To tell it the gender up front, create a Pre-call variable with the ID gender (all lowercase, exactly that) and send Male or Female, capitalized exactly like that. Any other value (male, M, …) is ignored, as if the variable wasn’t sent. How the gender is chosen:
  1. If gender has a valid value, that value is used.
  2. If not, Pearl guesses it from the firstName variable.
  3. Once the caller starts talking, the gender detected from their voice takes over.
If none of these gives an answer, Pearl’s speech isn’t adjusted for gender.
This is automatic: you don’t need to ask PearlVibe for it or mention gender in your prompt.

Best Practices for Using Variables
  • Use Descriptive Names: Clearly name variables for easy identification (e.g. customerEmail).
  • Describe In-call Variables: The Description is what tells Pearl what to collect and when.
  • Define Variables Early: Plan your variables before building the conversation flow.
  • Avoid Unnecessary Variables: Only create variables that are essential to your conversation.
  • Test Thoroughly: Run test calls to make sure variables are filled as intended.
  • Handle Data Securely: Be cautious with personal and sensitive information.
  • Use Allowed Values and Codes: When appropriate, define allowed values and codes for cleaner data.

Examples

Example 1: Personalizing an Outbound Call

Scenario: Notifying customers about a service upgrade.
  1. Variables:
    • Pre-call: customerName (Text), currentPlan (Text)
    • In-call: interested (Boolean), described as “Whether the customer wants to hear about the upgrade.”
  2. Script: “Hello {customerName}, we’re excited to tell you about an upgrade to your {currentPlan} plan. Would you like to hear more?”
  3. Transitions:
    • “The customer is interested” → the details of the upgrade.
    • “The customer isn’t interested” → thank the customer and end the call.
Lead Import Tip: add customerName and currentPlan to your lead file, with these exact IDs as column headers.

Example 2: Scheduling Multiple Dates

Scenario: Collecting several available dates from a customer.
  1. Variable: availableDates (Date & Time), with Allow multiple entries on.
  2. Script: “Which dates are you available for the meeting?”
  3. Usage: Pearl stores every date the customer gives in availableDates, ready to be sent to your calendar through an API node.

Example 3: Survey with Conditional Logic

Scenario: Gathering customer feedback.
  1. Ask for a score: “On a scale of 1 to 5, how satisfied are you with our service?”, stored in satisfactionScore (Whole Number).
  2. Transitions:
    • “{satisfactionScore} is 4 or 5” → a node thanking the customer.
    • “{satisfactionScore} is 3 or less” → a node asking for improvement suggestions.
  3. Follow-up: a post-call email using the collected data, thanking them or addressing their concerns.

Frequently Asked Questions (FAQ)

Mention the case in a transition (e.g. “The customer didn’t give an email address”), or ask for the value again in a Dialogue node. Once the conversation ends, empty variables are filled from the transcript when possible.
Yes. firstName and FirstName are two different IDs, in your flow as well as in lead files and API payloads.
Yes. Pearl can update a variable as many times as needed; the latest value replaces the previous one.
Use the template generated in the Leads tab, whose columns are your variables’ IDs, or the callData field when using the API.
Pre-call variables are known before the conversation starts, from a lead file, the API, or the call itself. In-call variables are collected by Pearl during the conversation, based on what the customer says.
No. All the variables of a test call are optional: leave empty the ones you don’t need for the test.
Nodes, actions, and prompts that use it lose its value. Check where it’s used before deleting it.

Conclusion

Variables make your conversations dynamic and personalized. With them, you can:
  • Collect and Store Customer Answers: Gather essential information during the conversation.
  • Personalize Interactions: Create tailored experiences for each customer.
  • Control Conversation Flow: Direct the conversation based on answers and data.
  • Integrate External Data: Bring in information from your systems, and send results back.

For additional support, contact our support team at support@nlpearl.ai.