Introduction
If you have ever worked with large datasets in Zoho CRM, you have likely run into one of its most common limitations — the zoho.crm.getRecords API can only return a maximum of 200 records per page. For businesses that store thousands of leads, contacts, or accounts, this restriction can become a serious roadblock when trying to automate data processing workflows.
In this tutorial, you will learn a practical and reliable method to retrieve more than 200 records from any Zoho CRM module using a Custom View, a CRM Variable, and a scheduled Deluge function. This approach is fully automated and does not require any third-party tools or external API integrations.
Whether you are building a nightly sync, a data aggregation report, or a background automation, this solution will help you paginate through all your records dynamically and efficiently.
Why Does the 200-Record Limit Exist?
Zoho CRM enforces a per-page limit of 200 records on API calls to protect server performance and prevent abuse. This is a standard practice across most CRM and SaaS platforms. However, Zoho does allow you to work around this by using pagination — fetching records page by page and incrementing the page number with each execution.
The challenge is doing this automatically, without manual intervention. That is exactly what this tutorial solves.
What You Will Need
Before getting started, make sure you have the following:
- Access to your Zoho CRM account with admin or developer permissions
- A Custom View already created in the module you want to retrieve records from (e.g., Accounts, Contacts, Leads)
- Your Custom View ID (found in the URL when you open the view)
- Access to Zoho CRM Settings → Developer Hub → Variables
- Access to Zoho CRM Settings → Automation → Schedulers
Step-by-Step Guide
Step 1 — Create a CRM Variable to Track the Page Number
The first thing you need is a CRM Variable that stores the current page number. This variable will be updated automatically after each batch of records is processed.
- Go to your Zoho CRM dashboard and click the Settings (gear) icon in the top-right corner.
- Under Developer Hub, click on Variables.
- Click Create Variable.
- Fill in the details as follows:
- Variable Name:
Page - Variable Type: Number
- Value:
1(this is the starting page) - Grouped Under: Choose your preferred variable group
- Variable Name:
- Click Save.
This variable acts as a persistent counter. Each time your scheduler runs and processes a page of records, it will increment this number by 1 — so the next run picks up exactly where the last one left off.
Step 2 — Find Your Custom View ID
Your Custom View ID is required to filter the records correctly. Here is how to find it:
- Navigate to the module in Zoho CRM where your Custom View is saved (e.g., Accounts).
- Click on the Custom View you want to use.
- Look at the URL in your browser. You will see a parameter like
cvid=XXXXXX000000029468. - Copy that ID — you will use it in the Deluge script below.
Step 3 — Create a Scheduler in Zoho CRM
A Scheduler is an automated function that runs at a defined interval. You will use it to run the record-fetching script repeatedly until all pages have been processed.
- In Zoho CRM, go to Settings → Automation → Schedulers.
- Click Create New Scheduler.
- Give it a meaningful name such as
"Fetch All Account Records". - Set the execution interval based on your needs — for example, every 2 hours, daily, or weekly.
Step 4 — Configure the Scheduler Argument
Your scheduler function needs to dynamically receive the current page number from the CRM Variable you created in Step 1.
- Inside the scheduler, click Edit Argument.
- Set the Argument Name to
page. - In the Value field, click the dropdown and select Zoho CRM Variable.
- Select your variable group and then select the Page variable you created earlier.
- Save the argument configuration.
This links the page argument directly to the CRM Variable, so it always reflects the latest page number stored in the system.
Step 5 — Write the Deluge Script
Now it is time to write the actual Deluge code. This script will:
- Fetch up to 200 records from the specified Custom View on the current page
- Check whether any records were returned
- If records exist, process them (you can add your custom logic here)
- If no records are returned, it means all pages have been processed — the variable is then reset back to page 1 for the next cycle
Here is the complete scheduler code:
Now, within the function, write a Deluge script that handles fetching records page by page.
// Fetch records from the Custom View for the current page
getdata = zoho.crm.getRecords("Accounts", page, 200, {"cvid": "YOUR_CUSTOM_VIEW_ID"});
info getdata;
valueMap = Map();
// Check if records were returned
if(getdata.size() == 0)
{
// No more records — reset the page counter back to 1
valueMap.put("apiname", "Page");
valueMap.put("value", 1);
resp = zoho.crm.invokeConnector("crm.set", valueMap);
info resp;
}
else
{
// Records found — process them here (add your custom logic)
for each record in getdata
{
// Example: info record.get("Account_Name");
}
// Increment the page number for the next scheduler run
valueMap.put("apiname", "Page");
valueMap.put("value", page +1);
resp =zoho.crm.invokeConnector("crm.set", valueMap);
info resp;
}
Important: Replace "YOUR_CUSTOM_VIEW_ID" with the actual Custom View ID you copied from the URL in Step 2 (e.g., XXXXXX000000029468).
Output -

Step 6 — Save and Activate the Scheduler
- Save your Deluge function.
- Activate the scheduler and set it to run at your desired frequency.
- Monitor the execution logs to confirm records are being fetched page by page.
Each time the scheduler runs, it fetches the next 200 records. Once all pages are exhausted (i.e., a page returns 0 records), the page counter resets to 1 automatically — ready for the next full cycle.
How the Pagination Logic Works
Here is a simple visual breakdown of the flow:
Scheduler Runs
↓
Reads "Page" Variable (e.g., Page = 1)
↓
Calls zoho.crm.getRecords("Accounts", 1, 200, {cvid: "..."})
↓
If 200 records returned → Process records → Set Page = 2
↓
Next Run: Fetches Page 2 → Process → Set Page = 3
↓
... continues until ...
↓
Page N returns 0 records → Reset Page = 1
This creates a continuous, self-managing loop that will reliably paginate through all records in your module.
Practical Use Cases
This technique is useful in a wide range of real-world scenarios, including:
- Bulk data processing: Apply logic to every record in a module, such as updating a field, sending notifications, or syncing to another system.
- Reporting automation: Aggregate data from all records and push summaries to Zoho Analytics or an external dashboard.
- Data cleanup: Identify and fix inconsistencies across all records in a large dataset.
- Integration workflows: Push all records from a Zoho CRM module to an external API or database in batches.
- Custom archiving: Move old records to a separate system after processing them.
Tips and Best Practices
Schedule wisely: Choose a scheduler interval that gives each batch enough time to complete before the next one starts. If processing is heavy, use longer intervals like 2–4 hours.
Add error handling: Wrap your core logic in error handling to prevent the page counter from getting stuck if an API call fails.
Test with a small dataset first: Before running on your full module, test with a Custom View that has fewer than 200 records to make sure the reset logic works correctly.
Log everything: Use info statements generously during development so you can trace execution in the function logs.
Respect API limits: Zoho CRM enforces daily API call limits based on your plan. Be mindful of how frequently your scheduler runs if you have a large dataset.
Frequently Asked Questions
Q: Can I use this approach with any Zoho CRM module?
Yes. The zoho.crm.getRecords function works with any standard or custom module in Zoho CRM. Just replace "Accounts" with your module's API name.
Q: What if I don't have a Custom View? Can I still use this?
Yes. You can remove the cvid parameter entirely and the API will fetch records from all records in the module. However, using a Custom View gives you better filtering control.
Q: Will the page counter reset automatically when all records are processed?
Yes — the script resets the Page variable to 1 when a page returns zero records, so the next cycle starts fresh from the beginning.
Q: Is there any risk of duplicate processing? If your scheduler interval is shorter than the time it takes to process all records, there could be overlap. Make sure your interval is long enough to complete the full cycle.
Q: Can I use this to update records as I fetch them?
Absolutely. Inside the for each record in getdata loop, you can add any logic you need — including zoho.crm.updateRecord calls to modify individual records.
Conclusion
The 200-record per page limit in Zoho CRM does not have to block your automation workflows. By combining a CRM Variable, a Scheduler, and a simple Deluge pagination script, you can reliably iterate through thousands of records automatically — without any manual effort or third-party tools.
This pattern is one of the most useful techniques in the Zoho ecosystem and applies to virtually any data processing scenario. Once you have it set up, it runs silently in the background, handling your data batch by batch on a schedule you control.
If you found this tutorial helpful, feel free to share it with your team or bookmark it for future reference. Have questions or a different use case in mind? Drop a comment below — I would love to help!