Rodger's helpful deluge scripts #4 - Bulk updating records using a deluge function

Rodger's helpful deluge scripts #4 - Bulk updating records using a deluge function

One of this things I love about Zoho is that there's so many ways to accomplish something. Want to mass update some records? Sure, we have the Mass Update function to update a single field. Need to update more than 1 field? Sure, we have she Sheet view, but what if you need to incorporate logic decisions or calculations into your record update?

You could use sheet view, but that's limited to 100 records at a time, and what if there's multiple logic decisions to be made? Well, you use a deluge function.

This is the function I use when dealing with relatively small numbers of records. It can work well up to a couple of thousand records:

Firstly you're going to create a standalone function with the following arguments:

v_module (string data type)
v_records (integer data type)

Then we're going to use the following code:

  1. // Create a list of pages based on the number of records in the module. This will take the  number of records, v_records, 
  2. // divide it by 200 (200 records per page) and then round up to the nearest whole number. It will then use this number to repeat the text "1,"
  3. // and finally, it will remove the last "," and convert the string into a list

  4. l_pages = repeat("1,",(v_records/200).ceil()).removeLastOccurence(",").toList();
  5. l_bulkUpdate = List(); // Create a list to hold the records for the bulk update
  6. v_page = 1; // set the first page number
  7. for each page in l_pages
  8. {
  9. l_records = zoho.crm.getRecords(v_module,v_page,200);
  10. for each record in l_records
  11. {
  12. m_record = Map();
  13. m_record.put("id", record.get("id"));
  14. m_record.put("updated", true); // Create a temporary checkbox in your module to track whether the record has been updated
  15. //
  16. // insert your code here
  17. //
  18. l_bulkUpdate.add(m_record);
  19. if ( l_bulkUpdate.size() == 100 ) 
  20. {
  21. bulkUpdate = zoho.crm.bulkUpdate(v_module, l_bulkUpdate);
  22. info "Bulk Update: " + bulkUpdate;
  23. l_bulkUpdate.clear(); // Clears the bulk update list after sucessful bulk update
  24. }
  25. }
  26. v_page = v_page + 1; // Index the page number by 1
  27. }
  28. if ( l_bulkUpdate.size() > 0) 
  29. {
  30. bulkUpdate = zoho.crm.bulkUpdate(v_module, l_bulkUpdate); // Final bulk update if the list size is greater than zero but less than 100
  31. info "Bulk Update: " + bulkUpdate;
  32. }

Now put your logic in where it says "// insert your code here" then you can save and execute.

Because we use the put the module name in a variable, you can use this code for any module and will be prompted for the module name and the record count when you click "Save and Execute"

This comes with a warning however - DO NOT TRY THIS IN PRODUCTION IF YOU'RE TESTING YOUR CODE. ALWAYS TEST THIS IN SANDBOX FIRST BEFORE USING IT IN PRODUCTION!!

Also, test out your code on a single record before testing out your bulk update. That way you won't have to undo a huge mess if something goes wrong.

This is by no means the ONLY way to bulk update records using a deluge function and will not work if you have tens or hundreds of thousands of records.

    Access your files securely from anywhere







                        Zoho Developer Community





                                              Use cases

                                              Make the most of Zoho Desk with the use cases.

                                               
                                                

                                              eBooks

                                              Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                               
                                                

                                              Videos

                                              Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                               
                                                

                                              Webinar

                                              Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                               
                                                
                                              • Desk Community Learning Series


                                              • Meetups


                                              • Ask the Experts


                                              • Kbase


                                              • Resources


                                              • Glossary


                                              • Desk Marketplace


                                              • MVP Corner




                                                        Manage your brands on social media



                                                              Zoho TeamInbox Resources



                                                                  Zoho CRM Plus Resources

                                                                    Zoho Books Resources


                                                                      Zoho Subscriptions Resources

                                                                        Zoho Projects Resources


                                                                          Zoho Sprints Resources


                                                                            Qntrl Resources


                                                                              Zoho Creator Resources



                                                                                  Zoho CRM Resources

                                                                                  • CRM Community Learning Series

                                                                                    CRM Community Learning Series


                                                                                  • Kaizen

                                                                                    Kaizen

                                                                                  • Functions

                                                                                    Functions

                                                                                  • Meetups

                                                                                    Meetups

                                                                                  • Kbase

                                                                                    Kbase

                                                                                  • Resources

                                                                                    Resources

                                                                                  • Digest

                                                                                    Digest

                                                                                  • CRM Marketplace

                                                                                    CRM Marketplace

                                                                                  • MVP Corner

                                                                                    MVP Corner







                                                                                      Design. Discuss. Deliver.

                                                                                      Create visually engaging stories with Zoho Show.

                                                                                      Get Started Now


                                                                                        Zoho Show Resources


                                                                                          Zoho Writer Writer

                                                                                          Get Started. Write Away!

                                                                                          Writer is a powerful online word processor, designed for collaborative work.

                                                                                            Zoho CRM コンテンツ






                                                                                              Nederlandse Hulpbronnen


                                                                                                  ご検討中の方




                                                                                                        • Recent Topics

                                                                                                        • Entire notebook that had notes has disappeared

                                                                                                          I don't know how tf this happened. All I did was uninstall and reinstall the mobile app after fixing a bug I had. After I reinstalled the app, everything was synced back except for one folder which had a bunch of notes in it. None of those notes are in
                                                                                                        • Mes débuts sur Zoho Forms | 13 champs à l'export ! seulement

                                                                                                          Bonjour, je débute sur Zoho Forms, je viens de créer un formulaire avec tests dans la foulée et je n'ai que 13 champs qui remontent sur mon export CSV alors que j'ai plus de questions et champs qui devraient remonter. J'ai actuellement une formule payante
                                                                                                        • Introducing real-time document commenting and collaboration in Zoho Sign

                                                                                                          Hi, there! We are delighted to introduce Document commenting, a feature that helps you communicate with your recipients more efficiently for a streamlined document signing process. Some key benefits include: Collaborate with your recipients easily without
                                                                                                        • Zoho Payroll: Product Updates - July 2025

                                                                                                          Over the past month, we've focused on making Zoho Payroll more flexible, compliant, and easier to use—whether you're processing complex payouts, ensuring accurate calculations, or meeting local tax regulations. Here's what's new: One-Time Payments and
                                                                                                        • Adding Photos Into Form (as a form creator)

                                                                                                          As the form creator, is it possible to add images to my form? (I don’t mean adding an image upload field, but rather inserting a JPG file into the form so that users can view the image.)
                                                                                                        • [Training] AI-Powered Application Development Bootcamp 2.0 - Zoho Creator

                                                                                                          Hello everyone, Ready to take your app-building skills to the next level with the power of AI? We’re excited to invite you to AI-Powered Application Development Bootcamp 2.0—a 90-minute, live training session designed to help developers, business users,
                                                                                                        • automations: Can I execute a step on a specific date?

                                                                                                          I have created a form in Zoho forms, and created a contacts list. I have also begun setting up an automation with the intention of sending the form to the contact list on a specific date every month (via email) for the entire year (essentially sending
                                                                                                        • What is the easiest/fastest way to attach an email or PDF to a Zoho record?

                                                                                                          Hi everyone, We use Outlook with Office 365 and have the need to either ideally attach a .msg email directly to an account or custom module in Zoho, or if not attach just the PDF that would be sent in that email. The Zoho plugin is very basic for Outlook
                                                                                                        • Free webinar! Close deals faster with Zoho Sign from Zoho CRM

                                                                                                          Hello, Are you tired of chasing down signatures and getting stuck with paperwork delays in your sales process? With the seamless integration between Zoho Sign and Zoho CRM, you can create and send documents for signing online, close deals faster, and
                                                                                                        • Files stores in Library Marketing Automation

                                                                                                          Hi, How can i switch from card view to list view in Marketing Automation My Files.?
                                                                                                        • Paid for upgrade and no change

                                                                                                          I paid the $24.99 rate to upgrade to Pro version and no change when I signed out and signed back in.
                                                                                                        • Issue with Code Snippet Styling Overlap in Zoho Landing Page

                                                                                                          Dear Support Team, I have encountered an issue on the Zoho Landing Page while working with code snippets. When I try to create a custom script and add HTML, CSS, and JavaScript within the code snippet, the styling appears to overlap and affect other code
                                                                                                        • Adding yearly Calander

                                                                                                          How to add Yearly calander and employee data from admin console
                                                                                                        • Zoho Leave Policy > Portugal maternity Leave 120 days or 150 days

                                                                                                          Hello All In this Portugal maternity Leave policy, the government allow employee to apply 120 days they will have 100% paid salary if they apply 150 days they take 80% of the paid salary minimum 1 days and maximum 120 days or 150 days Should i setup this
                                                                                                        • Feature Request - Copy Reschedule Link

                                                                                                          Hi Bookings Team, I had a client contact me today, to let me know that she can't make a meeting she booked this week. I can't remember if I included a reschedule link in email notifications, but I was thinking that it would be great if I could just open
                                                                                                        • eCommerce ZUG Virtual Meetup – Critical Role of e-Signatures in eCommerce

                                                                                                          Hello there! Are you in the ecommerce industry and looking for a secure, compliant e-signature solution to handle all your paperwork? From vendor onboarding and supplier contracts to internal HR and finance workflows, speed, scalability, and customer
                                                                                                        • blank page after login

                                                                                                          blank page after logging into my email account Thanks you
                                                                                                        • Zoho Desk iOS app update: Archived ticket list view

                                                                                                          Hello everyone! In the latest iOS version(v2.10.7) of the Zoho Desk app update, we have brought in support to access the 'Archived Ticket views' on the 'Ticket Views' screen. Tickets that have been Closed and inactive for 120+ days will be automatically
                                                                                                        • Upcoming Changes to LinkedIn Parsing in Resume Extractor

                                                                                                          Starting 31 July 2025, the Zoho Recruit Resume Extractor will no longer support direct parsing of candidate data from LinkedIn profiles. Why Is This Change Needed? In accordance with LinkedIn’s platform policies, extracting profile data through browser
                                                                                                        • Chart of Accounts

                                                                                                          Is it possible to reorder chart of accounts manually? Currently, when creating new sub accounts accounts, they appear in order they were created i.e. not in alphabetical or numerical order based on manually assigned account codes. It's very messy! Also,
                                                                                                        • Zoho People Candidate Unable to see Non Admin Data

                                                                                                          Hello All I have assign this user as specific user as Group CEO and have access all legal entity, business unit division When i login to the user and look into onboarding i do not see any data in the candidate view This is the admin view that i have 2
                                                                                                        • Issues With Image Formatting when Importing Word Documents as Articles

                                                                                                          Hello, I am having formatting issues when importing .docx files into articles. The documents look fine on Word, but once they are imported into an article, the images will overlap text and other images. Occasionally there will be added space between images
                                                                                                        • Zoho CRM Workflow and Function Backup Options

                                                                                                          Hi everyone! I have been able to make several backups of my CRM data and noticed that the Workflows and Functions are not included in these backups. To my knowledge, there is no backup feature for workflows and functions, which is problematic in of itself.
                                                                                                        • ZOHO COMMERCE 2.0 – Réinventer la vente, repenser la valeur

                                                                                                          Il y a cinq ans, nous avons lancé Zoho Commerce pour accompagner les entreprises dans la vente en ligne. À cette époque, notre objectif était clair : simplifier l'e-commerce. Aujourd’hui, le marché a évolué, tout comme les attentes des entrepreneurs.
                                                                                                        • Business hours in reports

                                                                                                          Hi. If I activate the business hours for my tickets. Does it affect in reports? I mean, if before, without working hours a ticket comes in on a Monday and closes the following Monday, in the resolution time in working hours I get 7 days. I want to know
                                                                                                        • Zia Field Prediction - Unable to Validate Dataset Entries

                                                                                                          Lastly, whenever we want to create a new field prediction, the status gets stuck in Incomplete and when I try to annotate tickets, I get an error message saying "Unable to validate dataset entries." I've tried deleting and recreating the prediction, but
                                                                                                        • Using an article already existing in Zoho Desk KB as a resolution for another tickets

                                                                                                          Hi, I've read about the Resolution tab of the Tickets and the ability of adding a Resolution to the Knowledge Base so that both agents and customers be able to access this information. However, and considering several tickets may be solved by following the same procedure, here's my question: if, for a ticket, I solved it and added the way I solved it as an article in our KB, is it possible to grab that article and use it as a resolution for another tickets with similar characteristics? If it's not,
                                                                                                        • How to create knowledge base article from api?

                                                                                                          How to create knowledge base article from api?
                                                                                                        • Disabling Smart Writing Assistant

                                                                                                          Hello, I've found this article when looking to disable the Zoho Smart Writing Assistant in our Zoho Desk environment. I appreciate that the article is for another Zoho solution, however, I was still unable to disable this feature! Could we please have
                                                                                                        • Offline mode on Android TV app?

                                                                                                          Hello! Is there a way to use Zoho Show offline in the Android TV app? I have an Android TV based projector, and I travel with it, and don't want to have to rely on a steady internet connection when giving a presentation.
                                                                                                        • Append tags to records on import

                                                                                                          Dear Customers, We hope you're well! Tags in Zoho CRM are humble labels you can earmark your records with for quick classification and recognition. You can tag records one by one when you have only a few records to update; you can automate tagging when
                                                                                                        • "Recently Changed Payload Format" for webhooks in Zoho Billing

                                                                                                          We are seeing a message about recently changed payload format for webhooks in zoho billing. I cannot find any notification about this change can you give me more information on this?
                                                                                                        • Zoho Sign and Zoho Workdrive Integration

                                                                                                          Hello, there. I want to know if it's possible to save a signed document from Zoho Sign in an specific folder for each signer in Zoho Workdrive.  For example: If John Doe signs the document in Zoho Sign I want to save it automatically in a folder named
                                                                                                        • Kaizen #198: Using Client Script for Custom Validation in Blueprint

                                                                                                          Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                                                                        • Zoho People Created a UBO/Group CEO Profile to view all employees

                                                                                                          Hello All I have created a specific role UBO/ Group CEO Profile that is able to access to view all employees information Applicability i have input all the legal entity, business unit and division which most employees are added. I have also given access
                                                                                                        • We've updated the webhook payload format

                                                                                                          We’ve updated the default payload format for webhooks as part of our ongoing efforts to standardize the webhook format across Zoho Finance suite of applications. Note: This change is also applicable for the webhooks configured from the Developer Portal.
                                                                                                        • Set File Upload fields as mandatory

                                                                                                          Currently the CRM for some reason lacks the ability to set a file upload field as mandatory So we have an issue We have a requirement that before a Deal stage is set as Deal is Won the member needs to upload a file Now for some weird reason in Zoho I
                                                                                                        • Zoho People > Access of Left Menu

                                                                                                          Hello All May I check how do i activate or de-activate of the left menu for users do i control via role or specific role? I have assign a user to Team member
                                                                                                        • Custom Button - Location Choice is not changeable in creation

                                                                                                          I created a custom button for the Tasks module that calls a function to streamline mass updates of closing tasks as "complete". I want to place it in either the utility menu or the mass action menu, but when I create the button the "select page" field
                                                                                                        • Workflow on Clone

                                                                                                          Hello. I'm interested on creating a workflow on a clone of a record in the Price_Books module that will clone also all the related Products and associate the new ones with the new Price_Book. My problem starts with that there's no On Clone event, only
                                                                                                        • Next Page