Tip 14: How to iterate a set of Deluge code a specific number of times.

Tip 14: How to iterate a set of Deluge code a specific number of times.



Hello folks,


As you might already know, recursive functions are used to  perform a particular action a specific number of times. We had explained this in detail in our Tip #2 . Similarly, there is another way in which you can iterate a set of Deluge code 'n' number of times. All you need to do is to create a List and use the For each index task to iterate it for a specific number of times. 

 

Here are a few use cases where this would be useful to you: 

  • To create 'n' number of duplicate records for every newly created record.

  • To perform a Send Mail task 'n' number of times.

  • To update old records in bulk.

In the below-given sample script, we are implementing the logic on a custom function and any workflow in your Zoho Creator application can trigger this function.


Let's consider the 'number' (int number) provided as input for the above function is 10. As a result, the function would return the below list.

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] 

 

  1. list listintgenerator(int number)
  2. {
  3. //We'll need to create a reference List for indexing purpose
  4. indx = number - 1;
  5. str1 = " ";
  6. val = leftpad(str1,indx);
  7. lst_val = val.replaceAll(" ","0,").toList();
  8. lst_temp = List:Int();
  9. counter = 1;
  10. //Iterate each index of the above generated List and perform counter operation
  11. for each index x in lst_val
  12. {
  13. lst_temp.add(counter);
  14. counter = counter + 1;
  15. }
  16. return lst_temp;
  17. }

 

Now, the generated List can be iterated using a For each task, and within that loop, you can add the set of Deluge code that has to be executed 10 times.

 

Hope this tip would be useful to many of you. Keep watching this space for more such tips.


    Access your files securely from anywhere











                            Zoho Developer Community





                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            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

                                                                                                            • Zoho FSM API to search Zoho FSM Assets by Asset_Number?

                                                                                                              How can I search or otherwise retrieve an Asset from the Assets module in Zoho FSM using the Asset_Number? The API docs seem to say that the only field that can be searched is the Asset Name. Is this true? https://www.zoho.com/fsm/developer/help/api/search-records.html
                                                                                                            • Sync Creator form submissions to WorkDrive folder

                                                                                                              I've made 10 Creator applications, and need to sync my each application's submissions into a WorkDrive folder. I need the form submissions to be PDF file type and sync to a specific folder for documentation purposes. I have tried to use a workflow, but
                                                                                                            • Add Voting Polls Feature Similar to WhatsApp to Zoho Cliq

                                                                                                              Hi Zoho Cliq Team, Hope you're doing well. We are using the Voting Polls feature in WhatsApp (see: WhatsApp Voting Polls FAQ), and we believe a similar functionality would be extremely valuable in Zoho Cliq. Currently, when our teams want to quickly gather
                                                                                                            • ZML Snippet: Auto Refresh Section

                                                                                                              Is there a way that I can set an auto refresh on each of the ZML snippet only and not the entire page? Just wondering..
                                                                                                            • Availability of the Custom Sort Order feature for Windows and Mac platforms??

                                                                                                              Notebook Team, I hope this message finds you well. I am reaching out to inquire about the current status and planned updates for the Custom sort order feature within your application. A year ago, it was mentioned that this feature is supported on iOS,
                                                                                                            • Have you checked your Email headers for DKIM Failure?

                                                                                                              Have you taken a look at your email headers for DKIM failures even with DKIM set up properly? I've had DKIM successfully set up for many months. My account currently shows Email Verified and Authenticated. Big green check marks. Email Relay is also showing
                                                                                                            • Wizard Form

                                                                                                              I would like the option to create a wizard that works when you create a record and contacts that are already in the CRM captured with a web 2 lead form (field data inserted in to the wizard).  Having the option to create up to 3/4 segments per screen
                                                                                                            • Pivot Table - Zoho Analytics

                                                                                                              I'm creating a Profit and Loss chart in Zoho Analytics using the Pivot Chart feature. While Net Profit can be calculated using the total value, I also need to calculate and display the Gross Profit/Loss directly within the chart. To do this, I need to
                                                                                                            • Fetch function not working for CRM Contacts

                                                                                                              I've created a flow that checks if a contact exists in CRM (based on form input), and if it does, then it updates one of the fields for the contact. In my test, the fetch function correctly identifies that a contact exists (based on email address), but
                                                                                                            • Clone a project

                                                                                                              To whom it may concern, I did a quick search of the forum and found nothing relating to this idea, so am posting fresh. The service that our company provides means that we follow an essentially identical process for each new job, and this includes the time frames for each stage. Ideally we would have a complete "template" project, with all the task lists and tasks in place with associated start dates, due dates (and by extension, duration) and - most importantly - the dependencies between tasks so
                                                                                                            • Add Sequential Processing Option in Zoho Flow

                                                                                                              Hi Zoho Team, I hope you're doing well. We would like to request a new feature for Zoho Flow: the ability to configure a flow to run in Sequential Processing mode — meaning, each instance of the flow waits until the previous execution is fully completed
                                                                                                            • Zoho Sign URL cannot be embedded in an iframe on the React side.

                                                                                                              The Zoho Sign URL cannot be embedded inside an iframe within a React application (or any web application) because Zoho enforces a Content Security Policy (CSP) that explicitly prevents iframe embedding from external origins. When attempting to load the
                                                                                                            • Zoho CRM Developer Series - Queries

                                                                                                              Hey everyone! We’re excited to invite you to our next Zoho CRM Developer Series focused on Zoho CRM Queries, happening on June 5, 2025 and June 26, 2025. Whether you're working on CRM customizations, integrating with third-party services, or just curious
                                                                                                            • Can Clients have Access to their record Attachments in Client Portal

                                                                                                              Is there a way to have allow clients access to attachments in their client portal? Attachments is currently hidden in the client portal and I cannot find a way to allow client access. Thank you!
                                                                                                            • Canvas: how can I edit theme?

                                                                                                              This says "Theme Colours", and I would like to edit theme colors (and styles ala CSS). How can I edit these "Theme Colours"? I'm a software developer, so just point me in a direction where I can alter code if needed.
                                                                                                            • CRM For Everyone - Bring Back Settings Tile View

                                                                                                              I've been using CRM for Everyone since it was in early access and I just can't stand the single list settings menu down the left-hand side. It takes so much longer to find the setting I need. Please give users the option to make the old sytle tile view
                                                                                                            • Mass Update of Lookup Fields not possible

                                                                                                              Hello List I've created a custom field for Leads and Contacts 'Current Campaign'. This is very Handy as I can filter leads and then related them to a campaign. Everything ready, but then I realized that mass update doesn't work for lookup fields... a
                                                                                                            • are Zoho Meeting and Zoho Webinar two separate products?

                                                                                                              hey all, i'm new to Zoho One and I'm trying to figure out what's the best platrofrm to do a Webinar for my subscribers. I see that Meeting have a Webinar option, but i see there's also a separate product (?) called Zoho Webinar. Are these two actually
                                                                                                            • Very Worst Experience = Screen sharing was Awful. There is a huge lag. I switched to Google meet, with same network speed, there is no lag at all.

                                                                                                              Very Worst Experience = Screen sharing was Awful. There is a huge lag. I switched to Google meet, with same network speed, there is no lag at all. Requesting you to work on your improvements. Otherwise this will give a very poor experience. Thanks,
                                                                                                            • Enable Native Zia Integration in Zoho Mail Without Requiring OpenAI API Key

                                                                                                              Hello Zoho Team, We hope you're doing well. We would like to request a feature enhancement for Zoho Mail's integration with Zia, specifically concerning the AI-powered capabilities like: Auto-complete sentences Generate email content Summarize email Currently,
                                                                                                            • Email policy not working?

                                                                                                              Hi, I created an email policy called "default", under which I created a "default" entry for the access items (the third icon with the key). I've set everything to "ON" (POP, IMAP, ActiveSync, etc.). But then when I create a new user and check it in Mail
                                                                                                            • One notebook is on my Android phone app, but not on Web or PC app.

                                                                                                              This problem started in stages. At first my phone was occasionally failing to sync. Then I noticed two things added to my Phone App. One was an existing notebook had a new cover, and the other was a new Note Card with an odd text in it. These were only
                                                                                                            • Admin Training

                                                                                                              Hello, I would like to get admin training on Zoho Projects. Has anyone had success in finding a class or resource for something like this? Are there any partners out there that offer this kind of training?
                                                                                                            • Why can't we change or delete the first page of a Zoho PDF?

                                                                                                              I've noticed that it's not possible to move or delete the first page of a Zoho PDF, why is that?
                                                                                                            • Latência

                                                                                                              Estou com bastante latência 200ms em São Paulo Brasil para o endereço mail.zoho.com, e email demora para carregar as vezes trava como está por ai ? segue print sabem se é normal ? ping
                                                                                                            • How to change the module for contact sync from Accounts to Accounts & their Contacts?

                                                                                                              Hi, My ZOHO CRM integration is broken and pushing the errors for sales orders and invoices, the error message is: "The customer associated to this record is not linked to module chosen in the current contact sync configuration." So, Now I'm trying to
                                                                                                            • Top Menu Disappeared from Blog Page

                                                                                                              Hi, Our top menu disappeared at Blog Posts page. However, it's still visible any other page on the website. I attached two screenshots, so it can be understood clearly. How can we bring back top menu? Thanks, K.
                                                                                                            • VOIP integration

                                                                                                              I emailed this question to rishi but never got a response. I notice when I mouse over phone number it has a link to launch into SKYPE. We dont use SKYPE we use Xlite SIP client. Is it possible to change that link to launch our client API? If so how? If not any plans to make that VOIP integration customizable?
                                                                                                            • Add "Ask Zia" Functionality for Report Creation in Zoho Desk

                                                                                                              Hi, How are you? We’ve noticed that Zoho CRM offers a very useful feature called "Ask Zia", which allows users to enter natural language prompts to generate reports quickly and easily using Zia's AI capabilities. Currently, Zoho Desk does not support
                                                                                                            • Compensation | Salary Packages - Hourly Wage Needed

                                                                                                              The US Bureau of Labor Statistics says 55.7% of all workers in the US are paid by the hour. I don't know how that compares to the rest of the world, but I would think that this alone would justify the need for having an hourly-based salary package option.
                                                                                                            • I can't use zoho in my personal computer

                                                                                                              Facing error on monitor Oops! An error occurred
                                                                                                            • My Zoho Account Not Working, Suddenly its stoped

                                                                                                              Hello Team, our company email account is not working, we are not receiving email. Website: www.urgentdubaivisaonline.com Email: social@urgentdubaivisaonline.com
                                                                                                            • MX verification

                                                                                                              Dear All I face a difficulties to verify MX records in my domain alfagrouptrading.sk it is since two days. records are correct and I am waiting for 48 hour I send email shown in the error message with no reply.in addition, it supposed to be propagated
                                                                                                            • I'm not receiving emails.

                                                                                                              Hello. I'm having an issue in which I am able to send emails using my zoho mail, but I seem to be unable to receive them. please help.
                                                                                                            • Change zoho email address

                                                                                                              I am displeased with the email address I created. It's too long.
                                                                                                            • Departments Limit

                                                                                                              There is a limit of departments that i can have on zoho desk?
                                                                                                            • How to create a form using both contact and account fields?

                                                                                                              I am sending a prefilled form from CRM with fields mapped, to update records in CRM. If I link the CRM field to the Contacts module, the Account Name field doesn't come up as an option in CRM. If I added it under Related Fields, my understanding it would
                                                                                                            • Boost your Zoho Desk's performance by archiving tickets!

                                                                                                              The longer your help desk operations are, the more likely it is to accumulate tickets that are no longer relevant. For example, ticket records from a year ago are typically less relevant than currently open tickets. Such old tickets may eventually lead
                                                                                                            • Are Zoho Help Center Email Notifications Customisable?

                                                                                                              Hi, I would like to find out if the Zoho Help Center email notifications can be customised to add our own styling and branding? These are the notifications that get sent when a client adds a new topic, adds a comment, signs up to the help center, etc?
                                                                                                            • Sharing and Converting Custom Reports Across Departments in Zoho Desk

                                                                                                              Hello, We initially started using Zoho Desk with a single department (Department "A"), which included multiple teams. Nearly a year later, we identified several limitations that led us to create three additional departments ("B", "C", and "D") with replicated
                                                                                                            • Next Page