

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).
- 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).

Accessing the Variable Manager
From the editor header
{ } button (Variables & credentials) in the header of the Pearl editor.

From a field
{ } 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.

Creating and Managing Variables
Add a variable
Fill in the variable details


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.


Define allowed values (optional)


Issue Type, Region). Pearl only picks from the list, and when a value has a code, the code is what’s stored.Save the variable


- 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.


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
{firstName}, which day works best for you?” Pearl says “Hi Jane, which day works best for you?”.Example in an SMS Node
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
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.

Example
- “
{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.Open the Leads tab
Upload a file


Or add a lead manually


Example CSV Entry
Adding Variables via API
- Use the Add Lead API Endpoint:
PUT /v1/Outbound/{outboundId}/Lead. - Include Variables in the
callDatafield of your JSON payload.
Example Request
Sending Variables in Single On-Demand Calls
- Use the Make Call API Endpoint:
POST /v1/Outbound/{outboundId}/Call. - Include Variables in the
callDatafield 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 anX- 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.
-.Example
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 IDgender (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:
- If
genderhas a valid value, that value is used. - If not, Pearl guesses it from the
firstNamevariable. - Once the caller starts talking, the gender detected from their voice takes over.
- 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
- Variables:
- Pre-call:
customerName(Text),currentPlan(Text) - In-call:
interested(Boolean), described as “Whether the customer wants to hear about the upgrade.”
- Pre-call:
- Script: “Hello
{customerName}, we’re excited to tell you about an upgrade to your{currentPlan}plan. Would you like to hear more?” - Transitions:
- “The customer is interested” → the details of the upgrade.
- “The customer isn’t interested” → thank the customer and end the call.
customerName and currentPlan to your lead file, with these exact IDs as column headers.Example 2: Scheduling Multiple Dates
- Variable:
availableDates(Date & Time), with Allow multiple entries on. - Script: “Which dates are you available for the meeting?”
- 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
- Ask for a score: “On a scale of 1 to 5, how satisfied are you with our service?”, stored in
satisfactionScore(Whole Number). - Transitions:
- “
{satisfactionScore}is 4 or 5” → a node thanking the customer. - “
{satisfactionScore}is 3 or less” → a node asking for improvement suggestions.
- “
- Follow-up: a post-call email using the collected data, thanking them or addressing their concerns.
Frequently Asked Questions (FAQ)
How do I handle empty variables?
How do I handle empty variables?
Are variable IDs case-sensitive?
Are variable IDs case-sensitive?
firstName and FirstName are two different IDs, in your flow as well as in lead files and API payloads.Can I change a variable's value during the conversation?
Can I change a variable's value during the conversation?
How do I include variables when adding leads via the platform or API?
How do I include variables when adding leads via the platform or API?
callData field when using the API.What is the difference between Pre-call and In-call variables?
What is the difference between Pre-call and In-call variables?
Do I have to fill in variables for a test call?
Do I have to fill in variables for a test call?
What happens if I delete a variable that's in use?
What happens if I delete a variable that's in use?
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.

