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

                                                                                                            • 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
                                                                                                            • Fetch Project's Task by Name

                                                                                                              Why is there no way to fetch a projects task by name? https://www.zoho.com/projects/help/rest-api/tasks-api.html#alink1 I have looked in the documentation but didn't find a way to fetch tasks by Task Name Am I missing something?
                                                                                                            • Error when adding an existing user to Zoho Project

                                                                                                              In the Zoho Projects Flow if an existing user is added to the project it results in an error There should be a way to automatically skip adding the user if it already exist in the Project instead of halting the whole Flow
                                                                                                            • Cannot Trigger Purchase Receive Flow from Both Books and Inventory

                                                                                                              I have created a flow for Zoho Inventory Purchase Receive Normally the purchase receive is created in Inventory, but sometimes the Purchase Receives gets created in the Books the the flow doesn't trigger Is there a way to trigger the flow whether the
                                                                                                            • New VAT Rate for South Africa

                                                                                                              Hi, When will the new VAT Rate be implemented as it is from 1 May 2025, and how will updates etc happen. Will there be a global update function. Thanks
                                                                                                            • South Africa VAT increase from 1 May 2025

                                                                                                              Hi Will Zoho Books automatically update the VAT settings from 15% to 15.5% or must it be done manually? The VAT rate is increasing to 15.5% on 1 May 2025, and supposedly to 16% in 2026. Regards Uwe
                                                                                                            • Power of Automation :: SLA for Tasks

                                                                                                              Hello Everyone, In this 'Power of Automation' series, we are focusing on the feature "Time-Based Workflow Rules for Tasks." Workflow rules help project managers organize tasks in a project by setting criteria and actions that meet the project requirements.
                                                                                                            • message var is empty in bot mention handler

                                                                                                              Hi, I'm encountering a problem: in my bot's mention handler, I want to retrieve the text the user typed when mentioning the bot. Example: On the #tests-cyril channel, I send this message: “@Donna hello how are you ?” I expect the system variable "message"
                                                                                                            • Restrict Payment Methods

                                                                                                              Allow us to restrict certain payment methods specific for each customer.
                                                                                                            • Widgets in People 5

                                                                                                              I'm trying to add a button widget in one of our test sites, created using the Zet-CLI Tool. When I host the Widget externally it runs fine, making a call to a UK Government API and downloading some json and displaying a table of data. If I try to host
                                                                                                            • No feedback from Zoho Books regarding Yodlee feeds for Investec

                                                                                                              I reported on 6 Feb 2025 that the Bank Feeds for Investec bank via Yodlee are not working. To date there has been no resolution. You are charging us for a suite of products where the functionality does not work. Please advise how you will refund me for
                                                                                                            • Convert a message on Cliq into a task on Zoho Connect

                                                                                                              Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
                                                                                                            • Zoho mail not working after Domain expiration and renewal

                                                                                                              Need help getting email working after an accidental domain expiration. Domain has since been renewed.
                                                                                                            • eway Bill - Import (Good / Material)

                                                                                                              As we Importer of goods , for That first we Generate PO then , Payment, then after We create Bill of Entry  After Bill of Entry Anywhere (99%) cases material that arrived to port that comes to warehouse / factory for that Eway bill , we have to create
                                                                                                            • In zoho creator I have Category form it has category name field Once Enter category name , category code want to Auo create on submit of the form

                                                                                                              In zoho creator I have Category form it has category name field Once Enter category name , category code want to Auo create on submit of the form Code Create Format first letter of product with number of product on this category Example: I have one use
                                                                                                            • Let's Talk Recruit: Meet Zia, your all-in-one AI assistant

                                                                                                              Welcome back to our Let's Talk Recruit series! Today, we are going to meet Zia, your all-in-one AI assistant. Let's delve into Zia's capabilities and explore how it takes tedious, time-consuming tasks off your plate. What is Zia? Zia is your AI companion
                                                                                                            • Zoho ONE Inventory and Zoho FSM

                                                                                                              Zoho ONE Inventory sees a warehouse just as a warehouse. You have to be a ZOHO ONE usher for example to use a warehouse like counting stock while you have to buy a warehouse as an Add one separately from ZOHO ONE Inventory to use it for ZOHO FSM In ZOHO
                                                                                                            • Export all of our manuals from Zoho Learn in one go

                                                                                                              Hi, I know there's a way to export manuals in Zoho Learn, but I want to export everything in one go so it won't take so long. I can't see a way to do this, can I get some assistance or is this a feature in the pipeline? Thanks, Hannah
                                                                                                            • How to Mass Delete 26K leads ?

                                                                                                              Hi, can anyone tell me how I can mass delete 26K leads please? Thanks Colin
                                                                                                            • 【Zoho CRM】サブフォームのアップデート

                                                                                                              ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中からサブフォームのアップデートをご紹介します。 サブフォームは、複数の行項目をまとめて管理できる副次的なフォーム/表です。例えば、営業チームがCRMのサブフォームを使って顧客の注文を管理する場合、商品名・価格・納期などの情報をまとめて入力できます。 ただし、このサブフォームのリスト自体が長くなると、スクロールが必要になり、画面上で確認する際に情報を把握しづらくなることがあります。 この課題を解決するため、サブフォームの列で「複数列のピン留め」と「項目列の幅の調整」の2つの新オプションの使用が可能になりました。
                                                                                                            • Is there a way to Prefill A Subform in Zoho Forms?

                                                                                                              By The Grace Of G-d. Hi, Is there any way to prefill a subform? Using URL Parameters or something else?
                                                                                                            • Updating Auto Numbers

                                                                                                              I'm removing a suffix from my auto number that's related to my customer record. I would like it removed from all existing customer records but I don't want to change the number before the suffix. If I tell it to update existing records, will it overwrite
                                                                                                            • How to add categories?

                                                                                                              How to add categories? I don't know if it is possible to create categories of the services, for example if the reported issue is a printer problem, hardware, email account, etc. I have only seen that the ticket is chosen if it is a complaint, question,
                                                                                                            • Zoho CRM in Microsoft Power Automate Custom Data Connector

                                                                                                              Hello, I have set up a custom data connector in Microsoft Power Automate. It is a connector to retrieve Zoho CRM data. I am pretty certain that I have entered the OAuth 2.0 authentication information correctly. However when I test the Get request https://zohoapis.com/crm/v2/leads.
                                                                                                            • Client Script: new value not set after calling setValue() - what's wrong?

                                                                                                              I'm new to Javascript and Zoho Client Script, though I have experience developing applications in C and Java. I have been trying to figure out why my code doesn't work and would appreciate help from the community to point out what's wrong. For my current
                                                                                                            • Sorry! we encountered some problems while sending your campaign. It will be sent automatically once we are ready. We apologize for the delay caused.

                                                                                                              Hello. Lately we are having problems with some campaigns, which show us this error message. Sorry! we encountered some problems while sending your campaign. It will be sent automatically once we are ready. We apologize for the delay caused. We can't find
                                                                                                            • ZOHO not recognizing mx records

                                                                                                              My domain hosting lapsed, and upon reactivating I had to recreate all my DNS records. ZOHO is not recognizing my MX records, but IS recognizing my SPF, DMARC, etc. Mail is being delivered to ZOHO just fine, but when I attempt to send I get a "relaying
                                                                                                            • mail rejected because of sender's SPF record issue

                                                                                                              We recently started hearing from customers that email is bouncing with the error: 550 5.7.23 Sender's SPF Policy Failure We cannot reject email because sender's DNS record is wrong. We need to accept mail in most cases. How do we fix this (because clearly
                                                                                                            • No fue posible enviar el mensaje;Motivo:554 5.1.8 Email Outgoing Blocked.

                                                                                                              Hola! quiero enviar un correo electronico desde mi casilla de correo " tallerenproceso@zoho.com" y no me permite, porque dice: " No fue posible enviar el mensaje;Motivo:554 5.1.8 Email Outgoing Blocked." lei que otros usuarios le daban respuesta de almacenamiento,
                                                                                                            • BLOQUEO DE POP-ENTRANTE

                                                                                                              Solicito con urgencia su apoyo, la cuenta dnanez@mirandacorredores.pe tiene problemas con el correo entrante. Tiene habilitado la opción POP en ZOHO y maneja sus correos con la herramienta Outlook, sin embargo no puede recibir ningún correo ya que aparece
                                                                                                            • Making preview pane "stick"

                                                                                                              Hello, Is it possible to fix/dock the preview pane so that it's always there? The modern monitors are all very wide so there's plenty of space horizontally. Having the preview pane disappearing and appearing again when you click on an email message in
                                                                                                            • Renew expired domain

                                                                                                              Hi My domain expired in early September. I tried to renew it but to make the transaction was an error. In the control panel, the renewal option does not appear. It happened more than 1 month and already I'm having problems with mail. When I go to a site
                                                                                                            • Print Email without Header Information - How?

                                                                                                              How do we print an email without printing the header? More and more vendors are emailing us invoices embedded in the email - not as an attachment. However, because the email print function automatically prints the email header, the invoices are split
                                                                                                            • Metrics available in Canada ?

                                                                                                              Hello, For the portal, the metrics looks empty for me. It says something like "no portal to display". Do I have to do something special to get it started or it is just not available yet for Canada ? Sylvain
                                                                                                            • In Zoho Desk, is there a way to see a list of comments that I've been tagged in?

                                                                                                              Thanks in advance!
                                                                                                            • Tracking product & invoice margins and costs

                                                                                                              We currently use Zoho Invoice and looking to understand how other people manage their product costs, margins, reporting etc. How do you know how much a particular job/invoice has made you and the costs involved? We have over 100,000 SKUs so not sure how
                                                                                                            • ZOHO ONE Inventory and ZOHO FSM

                                                                                                              Zoho ONE Inventory sees a warehouse just as a warehouse. You have to be a ZOHO ONE usher for example to use a warehouse like counting stock while you have to buy a warehouse as an Add one separately from ZOHO ONE Inventory to use it for ZOHO FSM In ZOHO
                                                                                                            • Get custom field value using deluge

                                                                                                              Hi everyone, I'm trying to get the value in a field using deluge in Desk, but i have i couldn't find an answer anywhere, this is my code : response = zoho.desk.getRecordById(OrgID,"tickets",TicketID); info response.get("cf_supplier");
                                                                                                            • Zoho Mail + Godaddy + Other Hosting how to configure

                                                                                                              Hi, I have taken zoho mail subscription, domain registered on godaddy and hosting taken from other hosting provider. So I have updated third party hosting nameserver on godaddy So now unable to add DNS records in Godaddy. Please give the solution.
                                                                                                            • Next Page