How to Create a Script in the Campaign Editor to Check Segmento Columns and Send Specific Campaigns
Using Script Conditions to Check Segmento Data and Deliver Different Messages Within a Single Campaign
Script Conditions in campaign allow you to filter users of Segmento dynamically and route them through different message paths within one campaign. Instead of creating multiple campaigns for each user type, you can use scripts to personalize communication based on the user factors that you have added in the Segmento —such as currency, location, purchase behavior, KYC status, or activity level.
This ensures that every user receives the most relevant content, while you manage everything from a single, unified workflow.
Why Use Script Conditions?
Script Conditions help you:
✔ Automatically segment users inside a single campaign
✔ Deliver different messages to different users based on your data fields
✔ Reduce manual effort—no need to create separate campaigns
For example:
Users with INR currency receive Email with INR pricing and for USD receive email with USD pricing update.
Users with 0 purchases receive first-order offers, more than 2 receives 10% offer WhatsApp message
Users with pending KYC receive reminders and KYC completed receives Next step Message
All of this is handled seamlessly within one campaign flow.
Where Script Conditions Are Used
Script Conditions are added inside the Editor Node within Multi-Channel Campaigns.
Steps:
Open Campaign → Create Campaign
Select Multi-Channel Campaign
Drag and drop the Editor (Script) Node from the right-side panel
Add your script
Connect the True and False paths to different communication nodes
Script Nodes act as decision-making checkpoints inside your workflow.
How Script Logic Works
Each script follows a simple structure:
const value = $['PhonebookName']['ColumnName'];
if (CONDITION) {
return true;
} else {
return false;
}
true → user enters the “Yes” (True) path
false → user moves to the “No” (False) path
You can chain multiple Script Nodes to create multi-level decision flows.
Example: Sending INR and USD Pricing in a Single Campaign
Script for INR Users
const currency = $['hello']['Currency'];
if(currency === "INR"){
return true;
} else {
return false;
}
Script for USD Users
const currency = $['hello']['Currency'];
if(currency === "USD"){
return true;
} else {
return false;
}
In your campaign flow:
INR → Send WhatsApp/SMS with INR pricing
USD → Send WhatsApp/SMS with USD pricing
Else → Send fallback/global communication
hello → Name of the phonebook
Currency → Name of the Segmento Column, in which the currencies are being stored user wise.
This is the most common use case: running multiple localized offers in one journey.
Use Cases Across Industries
Script Conditions help you create targeted flows across all key business verticals:
1. SaaS: Subscription Renewal
Check if subscription expires within 7 days and send renewal reminders.
2. Fintech: KYC Status
Filter users with KYC = Pending and send document-completion prompts.
3. D2C: Return/RTO Risk
Identify users with ReturnCount ≥ 2 and route them to special handling flows.
4. App Businesses: Inactivity
Detect users inactive for 14+ days and send reactivation campaigns.
5. Ecommerce: Purchase Behavior
Send different offers based on:
First-time users (PurchaseCount = 0)
Loyal customers (PurchaseCount ≥ 3)
High-value customers (LTV > defined amount)
All within a single campaign.
Example Multi-Path Campaign Structure
Here’s how a multi-branch flow typically works:
Start
↓
Check Currency
├── INR → Send INR pricing
├── USD → Send USD pricing
├── EUR → Send EUR pricing
└── Others → Send general message
A single workflow can support unlimited personalized paths simply by adding more Script Nodes.
Best Practices for Script Conditions
Use exact phonebook and column names
Keep comparison values consistent (case-sensitive strings)
For date comparisons, always use
new Date()Return only
trueorfalseTest with sample users before launching live
Reuse Script Nodes for similar conditions
Summary
Script Conditions are one of Segmento’s most powerful features. They allow you to:
Check user attributes
Filter data dynamically
Branch your campaign flow
Deliver personalized content
Automate complex communication logic
Reduce operational effort by running one campaign instead of many
By leveraging Script Nodes effectively, you can build intelligent, data-driven journeys that tailor content to each user at scale.