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:

  1. Open Campaign тЖТ Create Campaign

  2. Select Multi-Channel Campaign

  3. Drag and drop the Editor (Script) Node from the right-side panel

  4. Add your script

  5. 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 true or false

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