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

                                                                                                            • Creator portal user do not accept user password upon creation

                                                                                                              I placed a request at Zoho and they are working on it, but I try here too in case somebody has already the answer: Today, sudently, my customers that tried to join the portal were not abble to enter a valid password, even if the password had all the necessery
                                                                                                            • CRM Campaign -> Create Campaign ->Zoho Campaign. Add to Sender Address dropdown options (2024/08/01)

                                                                                                              I'm trying to add different Sender Address and Reply-to Address options to a new campaign created through Zoho CRM. There is one sender and reply-to address available and it is not the account I'm logged in with. The dropdown options do not match what
                                                                                                            • Create new ticket when another specific ticket is closed

                                                                                                              Hi. How can I create a ticket when another specific ticket is closed? So I have a ticket with subject 'Create agreement' connected to the contact of a customer. As soon as I close this ticket, I want that a new ticket is created (connected to the same
                                                                                                            • How can a Zoho Desk Admin access restricted files?

                                                                                                              How can a Zoho Desk Admin access restricted files from Zoho Desk that are not displayed to agents on tickets due to file type restrictions?
                                                                                                            • Need to bundle based on inventory stock not accounting stock

                                                                                                              Cannot create a bundle / composite item until a bill has been received, even if there is available stock due to an item receipt. This should be changed as it is required to make a bundle and invoice the customer before the vendor has billed us.
                                                                                                            • Can we make Transfer Orders based on Physical Stock?

                                                                                                              We are a manufacturing company and prefer to manage stock in "Physical Stock" mode. But if we don't have enough available quantity in "Accounting Stock", we couldn't make Transfer Orders, right? Is there any work around with this issue?
                                                                                                            • Why is my Lookup field not being set through Desk's API?

                                                                                                              Hello, I'm having trouble setting a custom field when creating a Ticket in Zoho Desk. The endpoint I'm consulting is "https://desk.zoho.com/api/v1/tickets" and even though my payload has the right format, with a "cf" key dedicated to all custom fields,
                                                                                                            • Ticket template - Send email to multiple contacts

                                                                                                              Is it possible to set up a ticket template with multiple contacts selected to receive an email, rather than just one contact as the default? We use Zoho Desk to send an email report to a group of contacts every day, and have to manually add each email
                                                                                                            • Zoho desk domain mapping not working

                                                                                                              Hi, I have followed this knowledge base support from your zoho site: https://help.zoho.com/portal/kb/articles/support-customers-from-your-own-domain-domain-host-mapping . First created a sub-domain(support.website.com), then went to zone editor to point "support.website.com" to cname desk.cs.zohohost.com . But it won't work out. What did I lack? Please I need it very much. Please see images below of the result: Please see below images of what I did: 1.)  2.) 3.) Hope to hear from you soon.
                                                                                                            • Zoho Analytics pulling data from Zoho Sheets and Zoho Forms

                                                                                                              It would be smart to have Analytics import data from Zoho Sheets or Forms. 
                                                                                                            • Exporting Presentations with Embedded Integrations

                                                                                                              I am embedding Zoho Analytics charts and tables - how can I export the presentations so that the embedded images show ? At the moment it just shows broken images . *note* I do not need the exports to have the live data or links - just a snapshot of what
                                                                                                            • Embedding Zoho Analytics - is the data always 'live' ?

                                                                                                              When embedding "live" Zoho Analytics data into a template with the intention of creating a monthly presentation - how are the embedded filters saved ? When a filter is applied to a presentation from a template is it then fixed for sharing or will it always
                                                                                                            • Zoho Flow Doesn't Detect Desk Ticket Custom Field Change

                                                                                                              I have a Flow that is configured to be triggered when a custom field on a ticket changes. I also have a Schedule in Desk that runs a script that changes the custom field. When I change the custom field manually in the Desk interface, the Flow runs as
                                                                                                            • Weekly Tips: Track Email Engagement with Read Receipts in Zoho Mail

                                                                                                              While email is a convenient and widely used way to communicate, it doesn't offer the immediate feedback you get from face-to-face conversations or phone calls. When we send an email, there is no way to know for sure if the recipient has acknowledged its
                                                                                                            • Reusable Variables

                                                                                                              I’d like to know if there’s a way to store variables in Zoho Analytics that I can use in metrics or calculations. For example, I have a Currencies table that stores the value of different currencies over time. I’d like to use the value of the US dollar
                                                                                                            • HTML Code + Writer Documents

                                                                                                              Hello, I am in the process of writing a couple of documents in Writer. Both document will have 2 versions each. One version being a freebee that perspective clients can download from my website. The other version will be a paid version, and additional
                                                                                                            • Audit Log: Detailed View and Export for Better Tracking

                                                                                                              Audit log tracks all the events or actions performed by the users and displays them in a sequential order. By default, all users who have admin access can view the audit log. We have added new features to the audit log that will enhance the user experience
                                                                                                            • Display All Admin Roles in Zoho One Admin Panel

                                                                                                              Hi Zoho One Team, I hope you're doing well. Currently, in the Zoho One Admin Panel, we can see Org Admins and Service Admins assigned to specific applications. However, admins assigned at the organization level for various Zoho apps (such as Mail, Cliq,
                                                                                                            • Enable users to create and edit presentations in your web app using Zoho Office Integrator

                                                                                                              Hi users, Did you know that your users can create, edit, and collaborate on presentations from within your web app? With Zoho Office Integrator's embeddable presentation editor, you can easily add these capabilities. Here are the highlights: Create presentations:
                                                                                                            • Forced Logouts - Daily and More Frequent

                                                                                                              In the last month or so, I've been getting "power logged out" of all of my Zoho apps at least daily, sometimes more frequently. This happens in the same browser session on the same computer, and I need to re-login to each app separately after this happens.
                                                                                                            • I can buy a Domine

                                                                                                              I need assistance with an issue I'm experiencing. Whenever I attempt to purchase a domain, I receive a message that says, "We ran into some trouble. Please try again later." I would greatly appreciate any help you can provide. Thank you. Please refer
                                                                                                            • Zoho Customer Statements open item and NOT balance brought forward

                                                                                                              How do I set my customer statements to open item and NOT just the balance brought forward. I would like the customer to see all the invoices outstanding
                                                                                                            • Free Webinar! From click to doorstep delivery | Enhance your ecommerce fulfillment process

                                                                                                              Free Webinar! From click to doorstep delivery | Enhance your ecommerce fulfillment process April 24, 2025, 12 p.m. EDT As your business grows into the ecommerce sector, so do the complexities of fulfillment. From managing real-time inventory to handling
                                                                                                            • Zoho Books Invoice Enable Payment Gateway with Deluge

                                                                                                              I am using this to create an invoice record in zoho books from zoho crm invoices. I want to add the ability to enable online payment gateway for "stripe".  I can not seem to find one article online on how to do this.  Can someone help? invoice = zoho.crm.getRecordById("Invoices",id);
                                                                                                            • Calculating Project Margins and Revenue per Hour in Zoho Analytics Using Data from Zoho Projects and Zoho Expense

                                                                                                              Hello, I would like to know if it's possible to use Zoho Analytics to calculate taxes and margins for the projects available in Zoho Projects, while also including the expenses recorded in Zoho Expense. I’m looking to build a dashboard that calculates
                                                                                                            • Having issue adding email account

                                                                                                              Hi Sir/Madam, I having an issue adding an email account (user and group). We have two organization but I am getting an error while adding the account in both User and group. Yet the account is not there. See attached.
                                                                                                            • UNEXPECTED RESPONSE CODE: 400"

                                                                                                              Getting this on all new flows created with a Zoho Campaigns connection
                                                                                                            • Suburb Categorisation/value

                                                                                                              Hi All, I have a list of suburbs that my company services, they are categorised by value to the business using a letter grade (A,B,C,D). When a lead is created I want the workflow to check the project suburb and then assign the related grade to a new
                                                                                                            • Launching AI-backed product recommendations for ecommerce stores

                                                                                                              As Zoho Campaigns steps into its 11th year, we're taking our first step towards artificial intelligence as part of our ecommerce module. Your emails—be they regular or automated— are equipped to carry unique and targeted product recommendations based
                                                                                                            • Add Custom Text Fields as a component in Dashboards

                                                                                                              Hi Team Idea: Adding custom text fields as components in dashboards. This will allow those of us creating the dashboards to better segment the dashboard into sections allowing a better front user experience where we are showing different categories of
                                                                                                            • FSM API ERROR Code "OAUTH_SCOPE_MISMATCH"

                                                                                                              I am trying to create a contact via the ZOHO FSM API https://fsm.zoho.com/fsm/v1/Contacts I have followed the instructions of the API documentation to Authenticate and Create a contact but I cant figure out what I am doing wrong. Bellow are the steps
                                                                                                            • Important Features Missing

                                                                                                              Hey all I love linkthread, but i am missing some important features. I want to be able to include my Google Tag Manager. I have all the important stuff in my GTM Container: Facebook Pixel, LinkIn Pixel, Zoho Pagesense and so on. So i am able to do retargeting
                                                                                                            • TaskList at Bottom from API

                                                                                                              When I create a taskList from API the TaskList is always At the Top, I need it to be at the bottom. How can I achieve that?
                                                                                                            • Linkthread domain names - none available

                                                                                                              Hi I am trying to add our domain names but they do not seem to be available but I am pretty sure they would not be taken as yet. Does Linkthread recognise .com.au or .org.au domains?
                                                                                                            • Setting default values in CardScanner app

                                                                                                              We use the Zoho Cardscanner app. Is it possible to set default values. For instance for "Lead source" to set the default value to "Exhibition". Now we have to manually select that for every card we scan.
                                                                                                            • Custom Fields like Discount

                                                                                                              Hi, Is it possible to make a custom field that acts like the discount field in quotes? I would like the option to have the field pop up exactly like Discount but instead of subtracting money it adds money (shipping cost in this case). I would like it
                                                                                                            • "Unable To Join Group Call"

                                                                                                              When trying to join a group call within Trident on macOS, I get a popup that says "Unable To Join Group Call". No other explanation is given. Anyone invited to a call should be able to join at all times, even if the organizer has not joined the call.
                                                                                                            • Effective project development with integration of Zoho Desk and MS Azure

                                                                                                              Dear partners, We are happy to announce that you can now integrate your Zoho Desk account with Microsoft Azure DevOps. This integration provides an effective way to: Manage feature requests Collaborate with teams Streamline development processes Dispatch
                                                                                                            • No-reply email account without taking up a user license?

                                                                                                              I just upgraded our zoho mail account to the paid tier and purchases 7 licenses. When setting up our new users I can't add the 7th one because I have a no-reply email account created to be able to send automated emails from our server. How do I go about having an account like that without taking up a user slot? All it needs is outgoing mail, no receiving or anything else.
                                                                                                            • ¿Por qué no te puedes perder los Workshops de Zoholics 2025?

                                                                                                              Cada año, Zoholics reúne a cientos de profesionales, emprendedores y entusiastas de la tecnología para compartir ideas, aprender unos de otros y descubrir todo lo que el ecosistema de Zoho puede ofrecer. Pero si hay una parte del evento que realmente
                                                                                                            • Next Page