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

                                                                                                            • Mobile no already in use

                                                                                                              When trying to bring up my email on another Zoho account I get asked, as a security measure, to add a mobile number. I have added a number before, but I tried again only to be told that the "Mobile number already exists", but I cannot proceed further.
                                                                                                            • error in making eway bill

                                                                                                              at the time of generating eway always a pope appers to enter the valid state code as state is auto gnerated while creating new customer
                                                                                                            • Need Feature to automatically fetch the registered GSTN Address of the AP Vendors

                                                                                                              Hello Zoho Need Feature to automatically fetch the registered GSTN Address of the AP Vendors and update the Zohobooks Vendor profile automatically so as to avoid manual address updations. Please do the needful here Thanks
                                                                                                            • Plug Sample #13: Display CRM Products as Dynamic Carousels in Your Chatbot

                                                                                                              Hi everyone! We’re back with another simple yet powerful plug to level up your chatbot experience. With the SalesIQ-CRM integration, you already have the ability to create leads, contacts, and deals directly within your CRM from SalesIQ, and view complete
                                                                                                            • Weekly Tips: Don't Delete, Just Archive

                                                                                                              For a business that relies heavily on email for communication, a cluttered inbox can be quite challenging to manage. Some emails can take up significant space in your inbox, making it difficult to navigate to other important emails. While these emails
                                                                                                            • Problema de sincronización de zoho mail con cliente Outlook

                                                                                                              Estoy presentando retardos en recibir los correos de Zoho en mi cliente Outlook a veces tarda mas de 20 minutos a pesar de haber llegado a la web no llega al cliente de escritorio y muchas veces debo cerrar el cliente y volverlo abrir para que llegue
                                                                                                            • Issue Updating URL Field with WorkDrive Link

                                                                                                              Hello, I’m working on a form with a file upload field. After uploading a file to WorkDrive, I fetch the public file link and update a field in the form with it. Workflow: When using the single-line text field ("File_URL"), the link is updated correctly
                                                                                                            • Should I Set Up Subdomain for Email Sends?

                                                                                                              Hi there, our team just bought a dedicated IP for our email sends. We send more than 100k emails/month. Because we face deliverability issues and also because of the mass sends, we decided to get a dedicated IP. My question is, should we set up subdomains
                                                                                                            • Incoming Email Not Coming Through

                                                                                                              Hi Zoho Team, I’ve recently set up my domain-based email with Zoho and everything appears configured correctly. However, I’m currently unable to receive any incoming emails. Could you please assist me in checking the following: MX records are set properly
                                                                                                            • Blocked: Reason 554 5.1.8 email outgoing blocked

                                                                                                              Hello, we have an issue while sending e-mails; whole organization with about 150 users is blocked "Unable to send message reason 554 5.1.8 email outgoing blocked", our domain is "ancient.global" Please help.
                                                                                                            • Error remote server is misconfigured

                                                                                                              Recently migrated the server to a new one. Updated MX records, SPF and DKIM values. DNS Lookup shows updated values. Still the email is getting bounced with the error: 553 Relaying disallowed
                                                                                                            • want to remove www

                                                                                                              I am trying to create my account but it doesn't let me erase the WWW . I don't need it for my email
                                                                                                            • Changer le lieu d'hébergement zohomail

                                                                                                              Est-il possible de faire héberger mon compte ailleurs qu'aux USA ? Compte-tenu de la situation de ce pays, un hébergement en Europe ou en Inde serait plus sûr.
                                                                                                            • Migration from Asana

                                                                                                              I see a lot of migration options for Zoho Projects, but don't seem to see Asana. Is there no clear migration path without going manual or custom?
                                                                                                            • NO RECIBO MAILS

                                                                                                              Hace más de 10 días no puedo recibir mails en mi correo. Si puedo enviar correos. Pueden ayudarme? Saludos, Christian Zegarra
                                                                                                            • I am not able to check in and checkout in zoho people even location access allowed

                                                                                                              This issue i am facing in mackbook air m1, I allowed location in chrome browser and i also tried in safari but getting similar issue. Please have a look ASAP.
                                                                                                            • Unable to receive emails

                                                                                                              Hi I am unable to receive emails but I am able to send externally
                                                                                                            • How to show User Full Name, not record id in a User Filter in analytics

                                                                                                              Please see screen recording: https://workdrive.zohoexternal.com/external/21a9e0c39c4595c255a62791fdf3655d3df933114a8f1598bc852d0ff7e56ce3
                                                                                                            • MTA-STS

                                                                                                              请激活对 MTA-STS 的支持,谢谢。
                                                                                                            • All my sent emails from KOMMO CRM System are redirected to one of a subfolder from my Ibox

                                                                                                              Hello, all of the sent emails from my KOMMO CRM System are placed in a sub-sub-folders in my INBOX. Why is that? And how can i change this?
                                                                                                            • Facebook emails aren't coming through

                                                                                                              Hi How can I get my business Facebook account emails coming through to Zoho mails? Every time they send me a verify email it's not coming through to my hosted email on Zoho... I've sent support and email but no reply so far. Any help appreciated please.
                                                                                                            • Query in Analytics for tracking Physical Available For Sale from Books

                                                                                                              Need: a query in Analytics on which we can build reports related to Physical Stock from Books items.  In Books, each item has an Accounting Stock and a Physical Stock. In the settings you can toggle the 'Mode of Stock tracking' option and we have selected
                                                                                                            • how to capitalize first letter of every word in a string using deluge?

                                                                                                              "diego armando maradona" to be "Diego Armando Maradona" "diego maradona" to be "Diego Maradona" "maradona" to be "Maradona" how to do that using deluge?
                                                                                                            • Data Discrepancy Between Zoho Books and Zoho Analytics

                                                                                                              We have connected our Zoho Books account to Zoho Analytics, but we are noticing that the data being imported is not accurate or consistent between the two platforms. Despite the integration, there are discrepancies in the data values. Could you please
                                                                                                            • Data Discrepancy Between Zoho Books and Zoho Analytics

                                                                                                              We have connected our Zoho Books account to Zoho Analytics, but we are noticing that the data being imported is not accurate or consistent between the two platforms. Despite the integration, there are discrepancies in the data values. Could you please
                                                                                                            • Option to Upload Employee Picture During User Creation in Zoho One

                                                                                                              Hi Zoho Team, We would like to request the addition of a new feature in Zoho One's employee creation process. At the moment, we can only upload a profile picture for an employee after the employee has already been created in Zoho One. Request: Please
                                                                                                            • Automatically Create Mailboxes for Existing Zoho One Users in Zoho Mail

                                                                                                              Hi Zoho Mail Team, I hope you're doing well. I understand that email assignment is automatic when adding users with an email address that has email hosting enabled in Zoho One Directory. However, when we initially created our users, email hosting was
                                                                                                            • Google Ads Data is Publicly available in Zoho CRM

                                                                                                              We recently discovered that ALL of the following Google Ads fields are visible to all users in our CRM that have access to either Leads or Contacts modules. Not only is this troubling and inconvenient, it should be unacceptable. It also creates a mess
                                                                                                            • Power of Automation :: Streamline Task Sync from Zoho Projects to Zoho Mail.

                                                                                                              Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:-
                                                                                                            • Digest Avril - Un résumé de ce qui s'est passé le mois dernier sur Community

                                                                                                              Bonjour chers utilisateurs, Un nouveau mois se termine au sein de Zoho Community France. Faisons le point sur cette période. Le mois dernier, nous avons abordé deux approches clés du marketing : l’e-mail, outil traditionnel et sûr, et les réseaux sociaux,
                                                                                                            • The corresponding module is currently disabled in Zoho CRM.

                                                                                                              getting this error message when trying to set up sync between crm and invoice The corresponding module is currently disabled in Zoho CRM.
                                                                                                            • Estimated Time for releasing in Australia?

                                                                                                              wondering if theres any timelines for when this feature might be availible to use in Australia?? would be very helpful sooner rather than later! Thank you :)
                                                                                                            • Zoho Books | Product Updates | April 2025

                                                                                                              Hello partners, We’ve rolled out new features and enhancements to elevate your accounting experience. From FEC report to BillPay Add-on, these updates are designed to help you stay on top of your finances with ease. Export Transactions in Factur-X Format
                                                                                                            • Please cancel my trial / subscription

                                                                                                              I’m doing a free trial of the Enterprise version. I’m trying to cancel it and make sure I won’t be charged a subscription. I can’t follow your help pages for this because I don’t get a sidebar with the details. I’ve wasted a lot of time trying to do this.
                                                                                                            • 日付別メール送信リストの作成

                                                                                                              日々顧客に個別にメールを送信しています 日付別に送信先リストを作成することは可能でしょうか?
                                                                                                            • 【Zoho CRM】キオスク機能のアップデート

                                                                                                              ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 今回は「Zoho CRM アップデート情報」の中から、キオスク機能のアップデートについて、 一部を抜粋してご紹介します。 キオスク機能とは? 特定の処理を行うための専用画面(キオスク)をノーコードで作成できる機能です。 自社の業務プロセスにあわせた画面の表示、タブをまたいだ処理などが可能です。 本アップデートにより、キオスクの柔軟性と操作性が大きく向上しました。 詳細について以下より確認しましょう。 <目次> データ取得機能:「データ選択不要」のデータ表示
                                                                                                            • Ability to Add Custom Favicon to Zoho Desk Survey Window

                                                                                                              Dear Zoho Desk Team, Greetings! We would like to request the addition of a feature that allows users to add a favicon displayed in the Zoho Desk Survey window. Currently, there is no option to set a favicon. Customizing the favicon would allow businesses
                                                                                                            • Campaigns Place-holder $ tags

                                                                                                              Hi there I’ve just started using Campaigns and I’ve been making use of the placeholder inserts available when constructing the email. However, in my contacts in CRM rather than have a first name and last name field I put their full name into the last
                                                                                                            • Setting Up Automated Lead Nurturing Campaign in Zoho CRM

                                                                                                              I want to create an automated lead nurturing campaign within Zoho CRM and Zoho Campaigns with the following requirements: Leads should receive a sequence of 5 emails, spaced 3 days apart. If a lead clicks a link in any email: A notification should be
                                                                                                            • Books Not Matching Transactions from Feed - "The total amount does not match with that of the transaction"

                                                                                                              Recently, transactions that are transfers from a foreign currency (FCY) account to a base currency (BCY) account are not allowing for matches with transactions from the bank feed. Please see the screenshots below: As one can see, the amount is in the
                                                                                                            • Next Page