Zoho Deluge Tutorial: Complete Beginner-to-Advanced Scripting Guide (2026)

// Zoho Deluge Tutorial — 2026 Guide

Zoho Deluge Tutorial: Complete Beginner-to-Advanced Scripting Guide with 7 Copy-Paste Scripts (2026)

The existing Deluge guides either cover basic syntax without working scripts or focus only on Zoho Creator without CRM examples. This guide is different — 7 copy-paste ready Deluge scripts built for Indian business contexts (IndiaMART leads, GST invoice automation, duplicate email validation), with step-by-step explanation of every line of code, from your first function to API integration.

Start Zoho CRM via Codroid Labs

Get Custom Deluge Scripts Built

Zoho Deluge tutorial complete beginner to advanced scripting guide 2026
Zoho Deluge tutorial — complete 2026 scripting guide from beginner to advanced with 7 copy-paste ready scripts for Zoho CRM, Creator, and Books

Zoho Deluge tutorial: Deluge is Zoho’s low-code scripting language that automates tasks across 50+ Zoho apps. It uses English-like syntax with variables, lists, maps, conditional statements, and loops. Key operations: zoho.crm.createRecord, zoho.crm.getRecordById, zoho.crm.updateRecord, sendmail, and invokeurl for external APIs. Used in CRM custom functions, Creator apps, Books automation, People workflows, and Desk ticket management.

Zoho Deluge tutorial — the most underused power in the Zoho ecosystem. Most Zoho users configure workflows and Blueprint but stop short of Deluge, not realizing that the gap between “what Zoho can do out of the box” and “what Zoho can do with Deluge” is enormous. Deluge scripting is the difference between a CRM that sends one email when a lead is created and a CRM that evaluates the lead’s source, company size, and industry, assigns it to the correct territory, creates a deal with the right stage, sends a personalized welcome sequence, and notifies the manager — all in the same function execution. This Deluge tutorial starts with the basics and builds to the 7 essential scripts that every Zoho developer and power user should have in their toolkit.

7
Copy-Paste Scripts
50+
Zoho Apps Use Deluge
Low-code
No deep coding needed
India
GST context examples

What is Zoho Deluge — overview, syntax, and where it runs

This Zoho Deluge tutorial and Zoho scripting guide starts with what Deluge actually is — not just a definition but an understanding of its role. Deluge (Data Enriched Language for the Universal Grid Environment) is Zoho’s proprietary Deluge scripting language that acts as the business logic layer across 50+ Zoho applications. What standard workflow rules cannot do — complex multi-step conditional logic, external API calls, record lookups before creating new records, calculations across multiple modules — Deluge handles. The Zoho Deluge overview syntax data structures functions explained: Deluge uses English-like syntax without semicolons at the end of most statements, without strict type declarations, and without complex object hierarchies. A variable is declared by assigning it. A list is declared with the List() constructor. API calls use the invokeurl keyword. This beginner-friendly scripting language Deluge for non-developers design means business analysts and power users with no traditional programming background can write functional scripts within hours of starting.

Deluge basics — variables, lists, maps, conditions, loops

Deluge basics for the complete beginner — the five building blocks of every Deluge script:

Variables and data types

// Variables in Deluge — no type declaration needed
companyName = "Sharma Enterprises Pvt Ltd";
invoiceAmount = 50000;
isGSTRegistered = true;
registrationDate = zoho.currentdate;

// India-specific example
gstState = "29";  // Karnataka state code

Lists — storing multiple values

// Create a list of Indian cities for lead assignment
citiesNorth = List();
citiesNorth.add("Delhi");
citiesNorth.add("Noida");
citiesNorth.add("Gurgaon");
citiesNorth.add("Faridabad");

// Check if a city is in the list
leadCity = input.City;
if(citiesNorth.contains(leadCity))
{
  // Assign to North India sales team
  updateMap = Map();
  updateMap.put("Owner", "north_sales@company.com");
}

Maps — key-value pairs for record operations

// Maps are used to create and update CRM records
dealMap = Map();
dealMap.put("Deal_Name", "Sharma Enterprises - CRM License");
dealMap.put("Amount", 150000);
dealMap.put("Stage", "Qualification");
dealMap.put("Account_Name", "Sharma Enterprises Pvt Ltd");

// Access map values
dealName = dealMap.get("Deal_Name");

Conditional statements — business logic

// GST-based pricing logic
invoiceValue = input.Amount;
if(invoiceValue > 1000000)
{
  // Enterprise deal — escalate
  info "High-value deal above Rs.10 Lakhs — Director approval needed";
}
else if(invoiceValue > 500000)
{
  info "Mid-range deal — Manager approval needed";
}
else
{
  info "Standard deal — auto-approve";
}

Loops — processing multiple records

// Loop through a list of records
deals = zoho.crm.searchRecords("Deals","Stage:equals:Proposal Sent",1,10);
for each deal in deals
{
  dealId = deal.get("id");
  dealName = deal.get("Deal_Name");
  info "Processing deal: " + dealName;
  // Update each stalled deal
}

Your first Deluge function — how to write your first Deluge function in Zoho CRM

How to write your first Deluge function in Zoho CRM — a welcome email sender for IndiaMART leads:

// Function: Welcome email for IndiaMART leads
// Module: Leads | Trigger: Record Created
// Location: Setup > Developer Space > Functions

// Step 1: Get lead details from the trigger record
leadName = input.Full_Name;
leadEmail = input.Email;
leadCompany = input.Company;
leadSource = input.Lead_Source;

// Step 2: Only send welcome for IndiaMART leads
if(leadSource == "IndiaMART")
{
  // Step 3: Send personalized welcome email
  sendmail
  [
    from : zoho.adminuserid
    to : leadEmail
    subject : "Thank You for Your Enquiry — We Will Call You Within 2 Hours"
    message : "Dear " + leadName + ",

Thank you for reaching out via IndiaMART. " +
              "Our team at " + leadCompany + " has been noted and our sales specialist " +
              "will contact you within 2 business hours.

" +
              "Best regards,
The Sales Team"
  ];

  // Step 4: Update lead status to acknowledge receipt
  updateMap = Map();
  updateMap.put("Lead_Status","Contacted");
  zoho.crm.updateRecord("Leads",input.id,updateMap);
}

To deploy this function: (1) Go to Setup → Developer Space → Functions → New Function → select Leads module → Standalone. (2) Paste the code. (3) Click Test → run against a sample IndiaMART lead. (4) If output is correct, Save. (5) The how to create workflow rules with Deluge in Zoho CRM step: go to Workflow Rules → Create Rule → Module: Leads → Trigger: Record Created → Action: Custom Function → select this function. This is the Zoho Deluge tutorial for beginners scripting examples step-by-step first complete deployment. The Zoho Deluge functions beginner tutorial write first script easy approach: start with this sendmail function before moving to record creation or API calls.

Working with Zoho CRM records in Deluge

Zoho CRM scripting fundamentals — the four core record operations:

// Create a new Lead record
leadData = Map();
leadData.put("Last_Name","Verma");
leadData.put("Company","Verma Traders Pvt Ltd");
leadData.put("Email","verma@vermata.com");
leadData.put("Lead_Source","IndiaMART");
leadData.put("City","Kanpur");
createResponse = zoho.crm.createRecord("Leads",leadData);
newLeadId = createResponse.get("id");
info "New lead created with ID: " + newLeadId;

// Get a record by ID
// how to get record by id in zoho crm using deluge script
leadRecord = zoho.crm.getRecordById("Leads",newLeadId);
leadName = leadRecord.get("Full_Name");
info "Lead name: " + leadName;

// Update a record
updateData = Map();
updateData.put("Lead_Status","Qualified");
updateData.put("Rating","Hot");
zoho.crm.updateRecord("Leads",newLeadId,updateData);

// Search records with criteria
// how to search records in zoho crm using deluge script
searchResults = zoho.crm.searchRecords("Leads","Email:equals:verma@vermata.com",1,5);
if(searchResults.size() > 0)
{
  info "Duplicate email found: " + searchResults.get(0).get("Full_Name");
}
Zoho Deluge tutorial code examples lead conversion email validation API India
Zoho Deluge tutorial — working code examples for lead conversion, email duplicate validation, record search, and API invokeurl integration

7 essential Zoho Deluge scripts every developer should know

1Lead conversion automation — how to automate lead conversion using Deluge script Zoho CRM

// Script 1: Auto-convert qualified leads to Contacts + Deals
// Trigger: Workflow rule when Lead Status changes to Qualified
leadId = input.id;
leadRecord = zoho.crm.getRecordById("Leads",leadId);
leadName = leadRecord.get("Full_Name");
leadCompany = leadRecord.get("Company");
leadEmail = leadRecord.get("Email");

// Create Contact from lead data
contactMap = Map();
contactMap.put("Last_Name",leadName.suffix(leadName.lastIndexOf(" ")));
contactMap.put("Email",leadEmail);
contactMap.put("Account_Name",leadCompany);
newContact = zoho.crm.createRecord("Contacts",contactMap);

// Create Deal linked to the contact
dealMap = Map();
dealMap.put("Deal_Name",leadCompany + " - New Opportunity");
dealMap.put("Stage","Qualification");
dealMap.put("Contact_Name",Map({"id":newContact.get("id")}));
zoho.crm.createRecord("Deals",dealMap);

// Update lead status to Converted
updateMap = Map();
updateMap.put("Lead_Status","Converted");
zoho.crm.updateRecord("Leads",leadId,updateMap);

2Duplicate email validation — how to validate duplicate email using Deluge in Zoho CRM

// Script 2: Check for duplicate email before saving a lead
// Used in: Zoho CRM Custom Validation Function
inputEmail = input.Email;

if(!inputEmail.isEmpty())
{
  // Search existing leads with same email
  duplicateCheck = zoho.crm.searchRecords("Leads","Email:equals:" + inputEmail,1,1);
  
  // Also check Contacts for same email
  contactCheck = zoho.crm.searchRecords("Contacts","Email:equals:" + inputEmail,1,1);
  
  if(duplicateCheck.size() > 0)
  {
    // Block save and alert
    alert "A lead with this email address already exists: " + duplicateCheck.get(0).get("Full_Name");
  }
  else if(contactCheck.size() > 0)
  {
    // Warn but allow — existing contact submitting again
    info "Note: This email is linked to existing contact: " + contactCheck.get(0).get("Full_Name");
  }
}

3Field update automation — Deluge script for Zoho CRM field updates beginners guide

// Script 3: Automatically set deal priority based on deal amount
// Trigger: Deal Created or Edited
dealId = input.id;
dealAmount = input.Amount;

priorityMap = Map();
if(dealAmount >= 1000000)
{
  priorityMap.put("Priority","High");  // Above Rs.10 Lakhs
  priorityMap.put("Owner_Reassign","senior_sales@company.com");
}
else if(dealAmount >= 500000)
{
  priorityMap.put("Priority","Medium");  // Rs.5-10 Lakhs
}
else
{
  priorityMap.put("Priority","Low");  // Below Rs.5 Lakhs
}

zoho.crm.updateRecord("Deals",dealId,priorityMap);

4Email notification automation — Zoho Deluge script examples for email notifications beginners

// Script 4: Deal closed won — notify accounts and dispatch team
dealId = input.id;
dealRecord = zoho.crm.getRecordById("Deals",dealId);
dealName = dealRecord.get("Deal_Name");
dealAmount = dealRecord.get("Amount");
accountName = dealRecord.get("Account_Name");

// Notify accounts team
sendmail
[
  from : zoho.adminuserid
  to : "accounts@company.com"
  subject : "Deal Won: " + dealName + " — Invoice to be Raised"
  message : "Team,

Deal " + dealName + " for " + accountName + 
            " has been marked as Closed Won.
Deal Value: Rs." + dealAmount +
            "

Please raise the proforma invoice and send payment terms.

Sales CRM"
];

// Notify operations
sendmail
[
  from : zoho.adminuserid
  to : "operations@company.com"
  subject : "New Delivery Order: " + dealName
  message : "New confirmed order for " + accountName + ". Please begin fulfillment planning."
];

5Pull lead source from contact to deal — Zoho Deluge beginner tutorial pull lead source from contact to deal

// Script 5: Copy Lead Source from Contact to a new Deal
// Trigger: Deal Created (Contact_Name is filled)
dealId = input.id;
dealRecord = zoho.crm.getRecordById("Deals",dealId);
contactId = dealRecord.get("Contact_Name").get("id");

if(!contactId.isNull())
{
  // Fetch contact record to get Lead Source
  contactRecord = zoho.crm.getRecordById("Contacts",contactId);
  leadSource = contactRecord.get("Lead_Source");
  
  if(!leadSource.isNull())
  {
    // Update deal with the same Lead Source
    updateMap = Map();
    updateMap.put("Lead_Source",leadSource);
    zoho.crm.updateRecord("Deals",dealId,updateMap);
    info "Lead Source copied from Contact: " + leadSource;
  }
}

6Related records and calculations — Zoho Deluge beginner guide to related records

// Script 6: Calculate total deal value for an Account
// zoho deluge beginner guide to related records and calculations
accountId = input.id;
accountRecord = zoho.crm.getRecordById("Accounts",accountId);
accountName = accountRecord.get("Account_Name");

// Fetch all open deals for this account
openDeals = zoho.crm.searchRecords("Deals",
  "Account_Name:equals:" + accountName + ";Stage:not_equal:Closed Lost",1,200);

totalValue = 0;
for each deal in openDeals
{
  dealAmount = deal.get("Amount");
  if(!dealAmount.isNull())
  {
    totalValue = totalValue + dealAmount.toLong();
  }
}

// Update account with total pipeline value
updateMap = Map();
updateMap.put("Pipeline_Value__c",totalValue);  // Custom field
zoho.crm.updateRecord("Accounts",accountId,updateMap);
info "Total pipeline for " + accountName + ": Rs." + totalValue;

7Scheduled function — daily stale deal detection

// Script 7: Scheduled function — runs daily at 9 AM
// Finds deals not updated in 7 days and notifies managers
todayDate = zoho.currentdate;
sevenDaysAgo = todayDate.addDay(-7);

staleDeals = zoho.crm.searchRecords("Deals",
  "Stage:not_equal:Closed Won;Stage:not_equal:Closed Lost;Modified_Time:before:" + sevenDaysAgo,
  1,50);

if(staleDeals.size() > 0)
{
  alertMessage = "The following " + staleDeals.size() + " deals have not been updated in 7+ days:

";
  for each deal in staleDeals
  {
    alertMessage = alertMessage + "- " + deal.get("Deal_Name") + 
                   " (" + deal.get("Stage") + ", Rs." + deal.get("Amount") + ")
";
  }
  
  sendmail
  [
    from : zoho.adminuserid
    to : "salesmanager@company.com"
    subject : "Stale Deal Alert — " + staleDeals.size() + " Deals Need Attention"
    message : alertMessage
  ];
}

Zoho Creator Deluge examples — form validation and workflow automation

The Zoho Deluge examples for Zoho Creator workflow automation and Deluge script validation on form submission Zoho Creator guide:

// Zoho Creator form validation — validate GSTIN format before submission
// On Validate section of a form
inputGSTIN = input.GSTIN_Number.toString();

// GSTIN format: 2 digits + 10 char PAN + 1 digit + Z + 1 check digit = 15 chars
if(inputGSTIN.length() != 15)
{
  alert "GSTIN must be exactly 15 characters. You entered " + inputGSTIN.length() + " characters.";
  cancel;  // Prevent form submission
}

// Check state code (first 2 characters should be a valid number 01-38)
stateCode = inputGSTIN.substring(0,2).toLong();
if(stateCode  38)
{
  alert "Invalid state code in GSTIN. First 2 digits should be 01-38.";
  cancel;
}

info "GSTIN format validated successfully.";
// automate tasks using deluge zoho creator tutorial for beginners
// On Success section — after form submission, sync to Zoho CRM
submittedRecord = input;
contactMap = Map();
contactMap.put("Last_Name",submittedRecord.Contact_Name);
contactMap.put("Email",submittedRecord.Email_Address);
contactMap.put("Phone",submittedRecord.Phone_Number);
contactMap.put("Account_Name",submittedRecord.Company_Name);

crmResponse = zoho.crm.createRecord("Contacts",contactMap);
newContactId = crmResponse.get("id");

// Update Creator record with CRM ID for cross-reference
updateCreator = Map();
updateCreator.put("CRM_Contact_ID",newContactId.toString());
zoho.creator.updateRecord("Creator_App_Name","Contact_Form",input.ID,updateCreator);

Integrating third-party APIs with Deluge invokeurl

The complete Zoho Deluge handbook syntax workflows API calls examples — invokeurl is Deluge’s command for making HTTP requests to external APIs:

// External API call example — SMS notification via a messaging API
// Trigger: Deal Closed Won — send SMS to sales rep

dealRecord = zoho.crm.getRecordById("Deals",input.id);
salesRep = dealRecord.get("Owner").get("email");
dealName = dealRecord.get("Deal_Name");
dealAmount = dealRecord.get("Amount");

// Construct API request body
smsParams = Map();
smsParams.put("to","91" + dealRecord.get("Owner_Phone"));
smsParams.put("message","Congratulations! " + dealName + " is CLOSED WON. Deal value: Rs." + dealAmount);
smsParams.put("api_key","YOUR_API_KEY");

// Make the API call
smsResponse = invokeurl
[
  url : "https://api.example-sms.com/send"
  type : POST
  parameters : smsParams
];

info "SMS sent. Response: " + smsResponse;

// GSTN API verification example
// Verify customer GSTIN against government portal
gstin = input.GSTIN;
verifyUrl = "https://api.gstn-verification.example.com/verify?gstin=" + gstin;
verifyResponse = invokeurl
[
  url : verifyUrl
  type : GET
  headers : Map({"Authorization":"Bearer YOUR_TOKEN"})
];

gstStatus = verifyResponse.get("status");
if(gstStatus == "Active")
{
  info "GSTIN " + gstin + " is Active";
}

Best practices for writing Deluge scripts

Use meaningful variable names
leadEmail not x. Deluge scripts are maintained by others — readable names save hours of debugging.
Add inline comments
// This checks for duplicate IndiaMART leads — document business logic, not obvious syntax.
Validate input before processing
Always check if(!inputEmail.isEmpty()) before using values — null inputs cause silent failures.
Keep functions modular
One function = one responsibility. A 200-line Deluge script doing 10 things is hard to debug and impossible to maintain.
Test in sandbox first
Use Zoho CRM’s sandbox environment to test Deluge functions against sample records before enabling in production.
Avoid unlimited loops
Always set a maximum limit on searchRecords and loop iterations — Deluge has execution time limits.

Codroid Labs — custom Zoho Deluge development India

Zoho Deluge tutorial for beginners scripting examples step-by-step, complete Deluge scripting guide for Zoho CRM beginners, 7 essential Zoho Deluge scripts every developer should know, copy-paste ready Deluge scripts for Zoho CRM Creator and Desk, Zoho Deluge beginner introduction to scripting and workflows, Deluge script for converting leads to contacts Zoho CRM example, Zoho Deluge scripting examples for Zoho CRM workflow rules, complete Zoho Deluge handbook syntax workflows API calls examples — Codroid Labs is a verified Zoho Authorized Partner (GSTIN 07AAWFC0815B1ZP) providing custom Zoho Deluge code development for Indian businesses. Our Zoho automation script work covers CRM automation, Creator app development, Books automation (GST invoice triggers, TDS compliance), and API integration with IndiaMART, payment gateways, and government portals. Zoho Deluge help, Deluge Zoho now, script Zoho CRM, Deluge functions, Zoho workflow script, Zoho scripting tips, Deluge code examples, script Zoho Deluge, Zoho script tutorial, Deluge beginner tips, learn Deluge Zoho, Deluge for beginners, Zoho Deluge examples, Deluge scripting, Zoho scripting guide, Zoho CRM automation, Deluge beginner guide, Deluge basics, Deluge examples, Deluge tutorial — contact: +91 78384 02682 or team@codroiditlabs.com.


Frequently asked questions — Zoho Deluge tutorial

How do I calculate vacation days off using Deluge in Zoho People?

The Zoho Deluge tutorial for calculating vacation days off beginners: Zoho People leave management can use Deluge to calculate working days between two dates excluding weekends and public holidays. Sample approach: define a list of public holidays for the year. Use Deluge’s zoho.currentdate functions to iterate through the date range between the leave start and end date. For each date, check if it is a weekend (date.getDayOfWeek() returns 1 for Sunday, 7 for Saturday) or in the public holidays list. Count only working weekdays. This function is typically deployed as a Zoho People custom function on the Leave module when a leave request is submitted, automatically calculating the correct number of business days and updating the leave days field before the leave record is saved.

What is the difference between Deluge and Zoho CRM Workflow rules?

Zoho Deluge tutorial context: Workflow rules in Zoho CRM handle linear, single-step automation — “when X happens, do Y.” They work without any scripting and cover the majority of standard use cases: send email, create task, update field, notify via webhook. Deluge (custom functions) handles everything workflow rules cannot: conditional logic with multiple branches, record lookups before performing actions, API calls to external services, calculations across related records, multi-module operations in a single execution, and looping through collections of records. In practice, use workflow rules for simple trigger-action pairs and Deluge for anything requiring “if-this-else-if-that-else” logic, external API integration, or operations on related records. External reference: Zoho Deluge official documentation for the full function library and syntax reference.

Need Custom Zoho Deluge Scripts Built for Your Business?

IndiaMART lead automation, GST invoice triggers, email duplicate validation, stale deal detection, Creator form workflows — certified Zoho CRM partner with GSTIN invoice. We write, test, and deploy your Deluge scripts. Free 45-minute technical consultation.

Start Zoho CRM via Codroid Labs

Book Free Deluge Technical Call – +91 78384 02682