Deluge tutorial · Zoho Creator and Zoho CRM
Deluge fetch records: a hands-on tutorial for Creator forms and CRM modules
Short answer: in Zoho Creator you fetch records by writing the form name with a criteria in square brackets, for example pending = Orders[Status == "Pending"];, and you can add sort by and range from ... to after it. In Zoho CRM there is no bracket syntax: you call zoho.crm.getRecords for a page of up to 200 records, zoho.crm.searchRecords for a filtered list, or zoho.crm.getRecordById for one record. This guide shows each form with sample code, paging, limits and the mistakes that return empty lists.
We reply within 1 business hour · No obligation
Also Zoho Creator Registered, Zoho Catalyst, AWS and Shopify Partner
Which Deluge statement fetches records in each Zoho app?
It depends on where the data lives. Records inside the same Creator app use the bracket syntax. Records in another Creator app, in Zoho CRM or in other Zoho apps come through integration tasks that return maps and lists, and those calls count against your plan's daily external call limit.
| Data sits in | Statement | Returns |
|---|---|---|
| A form in this Creator app | Form[criteria] | A collection of records you can loop, read and update |
| One field across many rows | Form[criteria].Field.getAll() | A list of values |
| A total or a count | .count(), .sum(Field), .maximum(Field) | A single number or date |
| A report in another Creator app | zoho.creator.getRecords | A map with code and a data list, 200 rows at most per call |
| A Zoho CRM module, page by page | zoho.crm.getRecords | A list of record maps, 200 per page by default |
| CRM records that match a condition | zoho.crm.searchRecords | A list of record maps |
| One CRM record you know the ID of | zoho.crm.getRecordById | One record map |
Zoho keeps the reference for the Creator side under fetch records in Creator's Deluge help. The examples below use a sample dispatch app with an Orders form; swap in your own link names, which are case sensitive.
How do you fetch records from a Zoho Creator form?
Write the form's link name, then the condition in square brackets, and assign the result to a variable. That variable is a collection: loop it with for each, or read a field straight from it when you expect one match.
// Sample dispatch app: pending orders shipping inside Karnataka
pending = Orders[Status == "Pending" && Ship_State == "Karnataka"];
for each ord in pending
{
info ord.Order_No + " for " + ord.Customer_Name;
}
A few rules decide whether that line returns what you expect:
- The criteria is required. To match every row, Zoho's help asks you to write
[ID != 0], since every record carries a system ID. Zoho also warns that pulling a whole form loads the server, so reserve it for small masters such as a tax or branch list. - Join conditions with
&&and||. Text values sit in double quotes; numbers and dates do not. To match against a list, usein:Orders[Ship_State in {"Karnataka", "Kerala"}]. - Name and Address fields need subfields. Write
Contact_Name.first_nameorSite_Address.postal_Code, not the parent field. - Records you fetch can be edited in place. Inside the loop,
ord.Status = "Packed";saves the change to that record. That is handy, and it is also how a test run quietly changes live data, so try it in a sandbox or on a copy first.
When you need one record, fetch by something unique and check the result before reading a field:
cust = Customers[ID == input.Customer];
if(cust.count() > 0)
{
input.Bill_GSTIN = cust.GSTIN;
input.Place_of_Supply = cust.State;
}
Reading cust.GSTIN on an empty collection gives a null rather than an error, so the check saves you from silent blanks on the form.
How do sort by and range work in a Deluge fetch?
Add sort by with a field name, plus desc for newest or largest first, then range from a start index to an end index. Sort must come before range, and both ends of the range are included.
// The ten most recently dispatched orders, newest first
latest = Orders[Status == "Dispatched"] sort by Added_Time desc range from 1 to 10;
// Rows 11 to 20 of the same list, for a second screen of results
nextTen = Orders[Status == "Dispatched"] sort by Added_Time desc range from 11 to 20;
- Order is not promised without a sort. Results often look like they follow Added Time, but Zoho says not to rely on that. If the first record matters, sort explicitly.
- Index 0 and index 1 both mean the first record. A negative index stops the script with a runtime error, so guard any range built from user input.
- Some fields cannot be sorted. Zoho lists Name, Address, multi select, multi select lookup, checkbox and the location fields. A lookup field sorts by the linked record's ID, not by its display text.
Use range to keep big forms fast. A report page that shows twenty rows does not need a function that fetches four thousand.
How do you fetch one field's values, a count or a total?
Chain the field name and getAll() to get a plain list of that field's values. For numbers, call an aggregate such as count, sum, maximum, minimum or average on the fetch, so Creator does the arithmetic instead of your loop.
// All dealer emails in one region, ready for a mail task
dealerMails = Dealers[Region == "North Karnataka"].Email.getAll();
// Figures for a daily summary
openCount = Orders[Status == "Pending"].count();
monthStart = zoho.currentdate.toStartOfMonth();
monthValue = Orders[Order_Date >= monthStart].sum(Grand_Total);
biggest = Orders[Order_Date >= monthStart].maximum(Grand_Total);
Two habits help here. First, getAll() returns a list, so you can pass it straight into an in criteria: fetch matching IDs from a child form, then filter the parent with Parent[ID in childIds]. Zoho suggests exactly this two-step route when a dotted criteria across parent and child forms will not work with multi select fields. Second, a count on a field such as a checkbox counts the choices ticked, not the records, so count on ID or with no field when you want rows.
For more ready-made patterns that use these lines, our Deluge code examples for Zoho collect short scripts for Creator, CRM and Books, and the Deluge syntax cheat sheet keeps maps, lists, dates and error handling on one page.
Can Deluge fetch records from a different Creator application?
Not with the bracket syntax, which only sees forms inside the current app. Use zoho.creator.getRecords with the owner name, app link name, report link name, a criteria string, a start index, a limit of up to 200 and an OAuth connection.
// Read pending orders from a separate sales app (sample names)
resp = zoho.creator.getRecords("owner_name", "sales_app", "All_Orders", "Status == \"Pending\"", 1, 200, "creator_conn");
if(resp.get("code") == 3000)
{
for each rec in resp.get("data")
{
info rec.get("ID") + " : " + rec.get("Order_No");
}
}
else
{
info "Fetch failed: " + resp.get("message");
}
Note three differences from a local fetch. You read a report, not a form, so the report's own filters apply on top of your criteria. Text values in the criteria string need escaped quotes. And every call that gets a reply, success or failure, counts as an external call, so a getRecords inside a loop of 300 rows spends 300 calls. Zoho documents codes such as 2892 for a wrong app name and 2894 for a wrong report name, so log the message when the code is not 3000.
How do you fetch records from Zoho CRM in Deluge?
Call zoho.crm.getRecords with the module's API name, a page number and a page size. Each page holds up to 200 records, so a module with 1,450 leads needs eight pages. For a filtered set, zoho.crm.searchRecords takes a criteria string instead.
// Read every deal, 200 at a time, newest changes first
allDeals = List();
pageList = {1,2,3,4,5,6,7,8,9,10};
for each p in pageList
{
batch = zoho.crm.getRecords("Deals", p, 200, {"sort_by":"Modified_Time","sort_order":"desc"}, "crm_conn");
allDeals.addAll(batch);
if(batch.size() < 200)
{
break;
}
}
info allDeals.size() + " deals read";
Deluge has no while loop, so a fixed list of page numbers with a break on a short page is the usual pattern. Size the list for your module, and remember each page is one external call. Positional parameters matter too: to pass the connection you must also pass every parameter before it, using an empty Map() or null where you have nothing to send.
Searching is cheaper when you only need some records:
// Distributor accounts billed in Karnataka (sample field names)
matches = zoho.crm.searchRecords("Accounts", "((Billing_State:equals:Karnataka)and(Account_Type:equals:Distributor))");
// One account when you already hold its ID, for example from a workflow
acct = zoho.crm.getRecordById("Accounts", accountId, "crm_conn");
info acct.get("Account_Name");
The Deluge help for searchRecords in Zoho CRM lists equals and starts_with as operators and allows up to ten conditions in one string. When a module runs well past 20,000 rows, a scheduled export through Zoho CRM's bulk read API usually costs far fewer calls than paging inside a function. If the fetch feeds an automation, read our Zoho CRM workflow rules setup guide first; a rule plus a field update often does the job with no fetch at all. Custom modules work the same way once you use their API name, which our custom modules tutorial shows you where to find.
Tap each card
Why does a Deluge fetch return nothing, or too much?
Most empty or wrong results trace back to five causes: a display name used in place of a link name, a lookup compared to text, an unsorted fetch read as if it were sorted, the wrong data type in the criteria, or a fetch placed inside a loop. Flip a card to see the symptom and the fix.
Behaviour summarised from Zoho's Deluge help as published in November 2026. Zoho revises tasks and limits, so check the live help page for your app and edition.
Match your script
Which fetch method should your script use?
Keep the situations that match your script and skip the rest. Each card points to the statement we would reach for first, and you can send your picks to us with the form below for a second opinion.
- Eight common Deluge jobs
- Picks stay on this page until you send them
How do you keep fetches fast inside Deluge limits?
Fetch fewer rows, fewer times. Narrow the criteria, use range when you only show a slice, aggregate instead of looping, and move any fetch or integration call out of loops. Each Zoho edition caps statements per function and external calls per day, so a lean fetch also keeps your automations running all month.
- One fetch, then a map. When you need a customer's details for each of 400 order lines, fetch the customers once with
in, put them in a map keyed by ID, and read from the map inside the loop. - Criteria on indexed, simple fields. Status, date and ID comparisons are cheap. A
containson a long text field across a large form is not. - Schedule the heavy reads. A nightly schedule that prepares a summary form is gentler than a form action that recalculates on every save.
- Log what you fetched. An
infoline with the count during testing shows quickly when a criteria returns 0 or 40,000 instead of 40.
Want someone to read your fetch logic before it goes live?We check criteria, sort, paging and call counts against your Creator or CRM edition, and say what to change.
Book my free Zoho fit assessmentWhen scripts grow into a full custom app, our Zoho Deluge scripting services team writes, reviews and documents the functions, priced as a fixed amount in a signed scope. If you would rather add a developer to your own team for a project or by the hour, see how to hire a Deluge developer. And if you are still deciding whether Creator is the right home for the app at all, our post on custom business apps on Zoho Creator covers that choice. Teams near our Vasanth Nagar office can also meet us about Zoho Creator projects in Bangalore. We train admins in English, Hindi, Marathi, Tamil, Kannada or Malayalam, on your own forms and scripts.
Written by
Who wrote this Deluge fetch records tutorial?
Our Creator and CRM developers wrote it. Elite Tech Corp is a Zoho Advanced Partner, also registered as a Zoho Creator partner, with 300+ Zoho projects behind it since 2021. The client quotes below are about our Zoho work in general, across several industries, not about this tutorial.
The team at Elite Tech Corporation is highly knowledgeable and extremely supportive. They took the time to understand each of our business use cases in detail and approached every requirement with a strong implementation mindset.
What stood out most was their structured approach, clarity in communication, and commitment to aligning technology with practical, on-ground operations rather than offering generic solutions.
Your understanding of our requirements and customization of Zoho Books have positively impacted our operations. The successful implementation of APIs and workflows has streamlined processes.
FAQ
Deluge fetch records: questions Creator and CRM admins ask
Got a fetch that returns an empty list? Paste the line into the form. We reply within 1 business hour.
Book my free Zoho fit assessmentHow do I fetch all records from a Zoho Creator form in Deluge?
Use the criteria [ID != 0], for example allBranches = Branches[ID != 0];. Every Creator record has a system ID, so this matches every row. Zoho warns that fetching a whole form adds load, so use it for small masters and filter larger forms.
What is the difference between a Creator fetch and zoho.creator.getRecords?
The bracket fetch, such as Orders[Status == "Pending"], reads forms inside the same Creator app and does not use external calls. zoho.creator.getRecords reads a report in another Creator app through a connection, returns up to 200 records per call and counts against the external call limit.
How many records can zoho.crm.getRecords return at once?
One page per call, and the page size defaults to 200 records. To read more, call it again with page 2, 3 and so on, and stop when a page comes back with fewer records than the page size. Each call counts as one external call.
Can I sort and limit the records a Deluge fetch returns?
Yes. Add sort by Field_Name, with desc for descending order, and then range from start to end. Sort must come before range, both ends of the range are included, and 0 and 1 both mean the first record.
Why does my Deluge fetch on a lookup field return no records?
A lookup field holds the ID of the linked record, not its display text. Compare it with the record ID, or first fetch the parent record by its name, take its ID and use that in the criteria.
How do I get a list of one field's values instead of whole records?
Chain the field and getAll() to the fetch, for example Dealers[Region == "Mysuru"].Email.getAll();. It returns a list you can pass to a mail task, a dropdown or an in criteria.
Does a Deluge fetch inside a for each loop cause problems?
Often, yes. A fetch or integration call repeated for every row slows the function and can hit statement or external call limits. Fetch once before the loop with an in criteria, store the results in a map keyed by ID, then read from the map.
Can Deluge search Zoho CRM records by a field value?
Yes, with zoho.crm.searchRecords and a criteria string such as (Billing_State:equals:Karnataka). The Deluge help lists equals and starts_with as operators and allows up to ten conditions joined in one string.