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

                                                                                                            • 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.
                                                                                                            • how to enable multi DC option in my organization tenant that using zoho sign to give chance to any external users from any DC to sign our docs?

                                                                                                              how to enable multi-DC option in my organization tenant that using zoho sign to give chance to any external users from any DC to sign our docs?
                                                                                                            • automatic follow up alerts if potential stage doesn´t change in a certain period

                                                                                                              I want to control the whole sale process through setting a different Lead status or Potential Stage each time the lead or potential reaches a certain milestone in the sale process. The idea behind that is that a change in the lead status or potential stage triggers rules which have tasks that move the sales process forward. For example, if a Lead asks for a quotation, the Lead owner will set its status as "converto to potential", which triggers a rule that has a task attached to convert the lead
                                                                                                            • How to set up ‘Adjusted Revenue’ in Zoho Books?

                                                                                                              Hello, I have a marketing agency where I typically offer social media management and advertising services to local clients on a retainer/monthly-recurring basis. One of my core services include Ad Spend (we call it Digital Media Buying), which contributes
                                                                                                            • Aliasing Tables in Reports

                                                                                                              I'm trying to build a Query Table in Zoho Reports using my Zoho CRM data, and I'm running into this error:   Whenever a table alias is defined, kindly use table alias name before the respective columns used in SELECT query I'm trying to create a query table that joins several aliases of the Contacts table to the Opportunities table.  For example, an Opportunity has a Primary Contact, a Referral Source, a Primary Liaison, and an Agent.  All four of these are represented in the Opportunities table
                                                                                                            • Close task from list view

                                                                                                              Hi everyone, I’m trying to find a way to streamline task management in Zoho CRM. Specifically, I want to know if it’s possible to add a button directly in the list view of the Tasks module one button per task that allows users to close a task without
                                                                                                            • Import or migrate a Word Press website into Zoho Sites?

                                                                                                              Is it possible to import or migrate a Word Press website into Zoho Sites?
                                                                                                            • Automatically open a widget

                                                                                                              How do I make a widget open automatically if a user views any record from a specific module?
                                                                                                            • Restrict Access to Dashboard Tab to some users

                                                                                                              Is there a way to restrict the access to a specific tab of my dashboard to some users? Say I have a dashboard of HR with 3 tabs, and I want to allow some users to have access to only 2 tabs. How could I do this? Thanks
                                                                                                            • Hotmail rejecting mail

                                                                                                              I have paid Zoho account. Hotmail is rejectying mail from Zoho because Zoho is on hotmail block list ---- On Tue, 15 Oct 2024 10:30:47 +1300 <mailer-daemon@mail.zoho.com.au> wrote --- This message was created automatically by mail delivery software. A
                                                                                                            • How to Send and Document for Signing using Power Automate?

                                                                                                              Hello Everyone, I am looking for a way to send a document for signature using Power Automate. Specifically, I would like to automate the process of sending documents (such as contracts or forms) to recipients for signing and also track the status of those
                                                                                                            • Zoho Sign not working in Canada Feb 06, 2025

                                                                                                              When logging into zoho sign a short while ago we are seeing gibberish in the standard buttons, and when clicked on nothing happens, rendering the service broken. Please update and advise soonest.
                                                                                                            • How to easily share and organize templates with users? We need template folders!

                                                                                                              Greetings, I have many requests for features of this software. We have many Zoho / ManageEngine products, and they are all so close to being awesome if it weren't for some fundamental shortcomings that I have been told repeatedly to "kindly submit a request"
                                                                                                            • Downloading chat history

                                                                                                              Is there a way to download our full chat history?
                                                                                                            • CRM Mobile - Ability to email Record Notes

                                                                                                              By accident, I found that if I long press a record Note in the CRM Mobile app, I can email the note and the attachment. This is a wonderful find. Question: Is there a way to email a CRM record Note from the desktop? Thank you! Amy
                                                                                                            • Zoho Books API Charging a customer with their Creditcard or ACH Banking info

                                                                                                              It is unclear if using this API, can acutally charge the customer. https://www.zoho.com/books/api/v3/customer-payments/#create-a-payment When we process invoices in Books, we Select "Record Payment" and then Charge Customer. The Client has either a CreditCard
                                                                                                            • Font Size 11 - Zoho CRM Email Templates

                                                                                                              Our company communicates with our vendors exclusively using Calibri Font Size 11, as this is the standard formatting for professional emails. Since the CRM only allows for the selection of font sizes 10 & 12, we have been unable to utilize the CRM email
                                                                                                            • zBooks Custom Script with deluge - Custom Field shows NULL

                                                                                                              I am trying to read a custom-field from the item module, which is a decimal. time = item.get("cf_reparatur_dauer_h"); The answer is always NULL. I have already seen similar topics in the forum, but they are already 4 years old and do not work (anymore).
                                                                                                            • Não consigo receber e-mails

                                                                                                              Não consigo receber emails, apenas enviar. Pode analisar o problema, please?
                                                                                                            • Can't search any new records

                                                                                                              I ran into an issue with search. I added a new contact and potential and couldn't find it when I did a search. I later found out from a Zoho CRM support rep that you can't search new records. The new records will never show up in search. You will have
                                                                                                            • Announcing new features in Trident for Windows (v.1.24.4.0)

                                                                                                              Hello Community, Trident for Windows is here with exciting new features to elevate your workflow and enhance productivity. Let’s dive into what’s new! Add WorkDrive files as attachments in the Mail Composer. Previously, you could only attach files from
                                                                                                            • Unfurling Unlimited Possibilities in Zoho Cliq 🔗

                                                                                                              Are you tired of your app links looking plain? Imagine if the shared links came to life with custom previews, organized data, and one-click actions, making chats more interactive. With the Cliq platform's unfurl handlers, let's see how developers can
                                                                                                            • Comparing 2 forms not linked to send email

                                                                                                              Hi, I want to compare 2 forms not linked, but with identical customer email fields. Form 1 : CustomerForm Form 1 fields : CustEmail, PartnerEmail, Reminder (yes-no) Form 2 : CalendarForm Form 2 fields : CustEmail, DeliveryDate, DeliveryLocation The aim
                                                                                                            • Outlook 2016 configured to Zoho

                                                                                                              I set up my Zoho mail in Outlook 2016. It works fine; however, Outlook often requests the Zoho Mail Password. Of course, the password is correct, but this isn't very annoying. Do you have any idea how to solve this?
                                                                                                            • Sending email to Gmail accts - Error Code :550 - 5.7.26

                                                                                                              Some of my emails to gmail accounts are coming back "undelivered mail returned to sender." It doesn't happen every time and sometimes I can just re-send and it goes through. Can someone help me fix this? Thanks, Christine ERROR CODE :550 - 5.7.26 This
                                                                                                            • Kiosk can't merge picklist or multiselect

                                                                                                              There is no ability to load a multiselect or picklikst field into a kiosk with the values that have been previously selected. So, I essentially have 3 unacceptable options: 1.)Load the value into a text string and include instructions like this: "Picklist
                                                                                                            • Enable more than one custom domain

                                                                                                              Hello Zoho team, we have more than one business inside of our CRM implementation. The two businesses have different websites and represent two sides of the same industry. So they are related to each other, but have different brandings. User of one business
                                                                                                            • MFA & MS Outlook

                                                                                                              I just installed the Zoho MFA app, and there's a problem. MS Outlook, on Mac, iPad, and Win10, can no longer access my email account. I can get in using a web browser, but not with Outlook. Outlook says it needs a password. I've tried my old password,
                                                                                                            • Possible to use Client Script to colour code picklist field value?

                                                                                                              I have hit the limit in my current subscription plan for colour coding picklist field values and need to colour code more picklist field values. Is it possible to achieve this functionality using the Client Script in Edit Page/Create Page/Clone Page
                                                                                                            • How can I update a field in Zoho CRM based on activity from FSM/Invoice

                                                                                                              We're trying to separate our clients into 3 categories based on the date they were last invoiced (not when a CRM deal has been won). I've set up a custom field called 'Last Invoice Date' in the Accounts module in CRM. I've also replicated this field in
                                                                                                            • Increase the rows that can be exported in a formatted report

                                                                                                              Hi Team An idea, increase the when exporting a formatted report, 2000 rows is too little and the detailed report would not allow me to keep grouping causing extra work when we export reports. Thankyou Josh
                                                                                                            • [Webinar] Why AI Must Stand on the Solid Foundation of Analytics & Business Intelligence

                                                                                                              Are you prepared for the age of AI? Organizations that have a solid foundation in analytics and business intelligence will be in a better position to harness GenAI, agentic apps, and intelligent automation. Join Doug Henschen and Mike Ni, VPs and Principal
                                                                                                            • Building extensions #5: Creating custom connections for extensions

                                                                                                              In our previous post, we discussed the significance of connections, identified their types, developed a predefined connection, and demonstrated how it can be integrated with Zoho Books using an example. In this post, we'll walk through the process of
                                                                                                            • Recurring Task Lists in Zoho Practice

                                                                                                              Is it possible to create a recurring tasks list in Zoho Practice? Looking to create a weekly task list with subtasks that once completed will repeat the next week and so on.
                                                                                                            • Sync Zoho CRM LEADS to Google Contacts

                                                                                                              I know it is possible within the CRM to sync contacts with Google contacts, which unfortunately is useless to me. I need to sync my LEADS from Zoho to Google contacts so that I can see their name when someone calls my iPhone. What is the solution? A paid
                                                                                                            • 无法发送消息;原因:5545.1.8电子邮件传出被阻止。

                                                                                                              求帮助,我的邮箱无法发送邮件,请尽快修复。 我们只是用来做正常的资料寄送,如果贵公司再无理封锁我们的邮箱,我们会改用其他公司的服务。 请尽快解封,ID: 815556404
                                                                                                            • Import records with multiple attachments to Zoho Recruit

                                                                                                              Hello, I want to import a CSV file with over 5000 records with some of them containing 6-10 attachments to the candidates module in my Zoho Recruit. Is there a way to make this import using the "Import from Spreadsheet" option in the candidates module?
                                                                                                            • Zoho Notebook API

                                                                                                              Hi there, I was wondering if you guys are planning to create an API service for this product? Currently, I have developed a custom program based on Evernote's API that allows me to automate my notes. The program completely changes the way notes are taken and makes anyone more productive, combining notes, logging, reminders, tasks and time management. I would love to deploy it on the Zoho Notebook API. In fact, I think this would be the perfect product for Zoho to package and offer as a service/product.
                                                                                                            • APAC ZUG Workplace Meet-up 2025—Time to Register!

                                                                                                              Dear Zoho Workplace Community, We’re thrilled to announce that the Zoho User Group (ZUG) Workplace Meet-up 2025 is heading to the APAC region! This year, we’re bringing the conversation closer to you—across multiple cities in Asia-Pacific—to connect,
                                                                                                            • Next Page