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

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



Hello folks,


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

 

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

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

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

  • To update old records in bulk.

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


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

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

 

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

 

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

 

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


    Access your files securely from anywhere











                            Zoho Developer Community





                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                  • Ask the Experts





                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator Resources



                                                                                      Zoho CRM Resources

                                                                                      • CRM Community Learning Series

                                                                                        CRM Community Learning Series


                                                                                      • Kaizen

                                                                                        Kaizen

                                                                                      • Functions

                                                                                        Functions

                                                                                      • Meetups

                                                                                        Meetups

                                                                                      • Kbase

                                                                                        Kbase

                                                                                      • Resources

                                                                                        Resources

                                                                                      • Digest

                                                                                        Digest

                                                                                      • CRM Marketplace

                                                                                        CRM Marketplace

                                                                                      • MVP Corner

                                                                                        MVP Corner







                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

                                                                                              Writer is a powerful online word processor, designed for collaborative work.

                                                                                                Zoho CRM コンテンツ




                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方




                                                                                                            • Recent Topics

                                                                                                            • Zoho Campaigns - how to have distinct Lead and Contact segments?

                                                                                                              Hi, I have been using Zoho Campaigns for quite a while now. What is not clear to me is how to have distinct segments for Leads and Contacts. I tried and used filters to do the trick, but that doesn't always work as I expect. For instance, converted Leads
                                                                                                            • OAuth Error - {"error":"invalid_code"}

                                                                                                              curl -v --ipv4 -X GET \ --url 'https://accounts.zoho.com/oauth/v2/auth?response_type=code&client_id=[CLIENT_ID]&scope=AaaServer.profile.Read&redirect_uri=https://my-real-domain.com/zohocallback.xhtml&prompt=consent&access_type=offline' RESPONSE Location:
                                                                                                            • Zoho Campaigns Pop Up not scaling properly on phone browser

                                                                                                              The pop up for the sign up for my mailing list works fine on my browser on PC, but on phone, it only shows half of the pop up. How do I fix this?
                                                                                                            • 📣📣 Zoho Bookings - Feature Roadmap 2024

                                                                                                              Hi Everyone, Thank you for all the support you have been showing Zoho Bookings. We had a fabulous 2023, with a bunch of new features and over 60K new users. In 2024, our prime focus will be on user experience, and we have a few vital features coming in
                                                                                                            • Cannot add Outlook Calendar to Zoho Bookings

                                                                                                              Hello, When I try to add my Outlook Calendar to Zoho Bookings I get almost to the end, including accepting the permissions and authorising the Office 365 account then I get the error message "Something's not right on our side. Sorry about that. Please
                                                                                                            • booking link that expires

                                                                                                              I have a suggestion that is  crucial. When i send booking URL to clients they keep the link and they book appointment whenever they want multiple times. You should give us the Booking URL feature. We should be able to send it and the user can use it only
                                                                                                            • Bookings - How do you select more than 1 service?

                                                                                                              Hello - I'm setting up a client with CRM and Bookings. She is a beautician that needs to have people book more than 1 service at time. Some services are add-on and she wants to collect a deposit but not the full payment.  How do we allow the clients to book more than 1 service at a time? Can the system take partial payments?
                                                                                                            • Canvas: is it possible to have a fixed header?

                                                                                                              Hello. Does Canvas provide the option to have a fixed header, similar to the standard view? It would also be interesting for other parts of the interface, like the header or sidebar of the tab section. Thanks!
                                                                                                            • Introducing ICR in Zoho CRM: Transform your printed text into digital data

                                                                                                              From writing on papyrus in the ancient times to creating a humble record in your CRM, the world may have evolved with how it used to record data, but data entry as such has not been simplified. It is still a repetitive and arduous chore on which businesses
                                                                                                            • Auto-Generate & Update Asset Serial Numbers using a custom function (Assets Module)

                                                                                                              Hello Team, I’ve been working on a script to automate one of our processes in Zoho FSM, and the core functionality has been successfully implemented. However, I’m encountering an issue related to serial number allocation, which is not working as expected.
                                                                                                            • Linking Reports and Projects to CRM Portal

                                                                                                              Is there a way to link reports and projects to a CRM portals?
                                                                                                            • How to filter deals for anything not yet delivered

                                                                                                              Hello I want to be able to filter my deals for anything where the Sales Order is not delivered. I'm stuck because I want to include deals with and without Sales Orders, and just exclude ones with an associated Sales Order which is stage Delivered Does
                                                                                                            • Currency fields and decimal places in CRM email templates

                                                                                                              Hi, How do I get more than the standard 2 decimal places showing in a Currency field, on an email template? In the Layout for my Currency field, it is set to 6 decimal places. I want to show up to 6 places in the email template (unrounded). See attached
                                                                                                            • Package Dimensions

                                                                                                              Packages need to have dimensions that are sent to carriers in addition to just the weight. Without the package dimensions being transmitted to carriers, the correct dimensional weight is not calculated for the label price, which results in corrections
                                                                                                            • Zoho One for Multiple Organisation under a Parent Company

                                                                                                              Dear Zoho One, We are a two companies running different business (service and sales) in Malaysia, with our parent HQ in Germany, and we have multiple sister companies scattered across the region of Asia.  Currently, our malaysia branch is using Zoho CRM and are in the process of upgrading our accounting system with Zoho One. However, there is one huge problem, and that is Zoho Apps does not allow us to run multiple organisations with a single subscription. This is our only deal breaker at the moment/
                                                                                                            • Track All Emails from Company Domain

                                                                                                              For our business model, it's almost impossible to keep track of all emails sent to clients, under the way ZohoCRM currently tracks emails to customer records via the user account only. We'd like to see a way of tracking emails via domain only, separate
                                                                                                            • New in Zoho Sign: Allow recipients to review and change associated recipients

                                                                                                              Greetings! We are happy to announce the addition of a new recipient role, Manages recipients, in our signature workflows. This role enables a recipient to review, modify, or add details for any recipients associated with them in the workflow. This ensures
                                                                                                            • Workable tutorials on Zoho RPA sorely needed - who can share?

                                                                                                              Hi folks, I own several RPA tools and would love to switch to Zoho RPA just to keep everything in the same ecosystem. However, Zoho RPA documentation lacks examples of how to do the most basic activities where RPA is most common. In particular: 1. opening
                                                                                                            • Need head start/ideas for a new application using the portal

                                                                                                              Hi, I am just looking for ideas, or direction, about a new app. Simply put, I have multiple vendors offering products, and multiple customers buying those products. BUT the administrator controls the product offering and prices. For example, Vendor "A"
                                                                                                            • SMTP zoho email + prestashop problem

                                                                                                              Hi,  i just created an email for my domain with an e-shop built on prestashop... however, after setting the SMTP (myemail@mydomain.com, password is correct, server is smtp.zoho.com, port 465, SSL) i still get an error message saying i should check my settings. with gmail address it works fine, but zoho has a problem.. anybody encountered this problem, or has any idea or solution? thanks a lot.
                                                                                                            • Cannot paste consistently

                                                                                                              When authoring and editing articles in Zoho Learn, I often find that I am unable to paste content. Some days, Zoho will let me paste a few times using keyboard shortcuts (Ctrl-V), but then will randomly stop allowing this function.  I have also tried
                                                                                                            • Recording stripe fees for sales w/out invoices

                                                                                                              In my business, people make many purchases w/out an invoice using a credit card. With invoice payments, I record them as sales and deposit the $ to credit card clearing, deduct stripe fees associated on the bank fees line, and then I record the stripe
                                                                                                            • Fields from Zoho CRM not appearing in merged document

                                                                                                              Hi, I have a custom CRM module where certain fields are looked up from "Contacts". When I then try to run a mail merge from my custom module, the date from the fields which were fetched from contacts do not appear in the document. I just see the field
                                                                                                            • Going back to older version

                                                                                                              Hi, One of our tech did a new version of our app, but created problems that we do not have time to repair, we just want to go back to an older version for the moment. To make sure we choose the right older version, we also want to double-check the dates
                                                                                                            • Zoho Creator HTML Page

                                                                                                              Hello Team, I have a query related to the HTML page I created in Zoho Creator. I would like to apply some filters on this page without passing them through URL parameters. Could someone please guide me on how this can be achieved? Thanks & Regards, Piyush
                                                                                                            • Remote Assist Reboot - User can't login

                                                                                                              Last night one of our support agents was using Zoho Assist doing a remote assist session.  A reboot was required. Upon rebooting the Windows 10 user says he can't login and that he is getting an invalid password error.   Is this a known problem? Any thoughts?  Awaiting customer to arrive at work today to attempt safe mode boot.
                                                                                                            • Move a ticket from one department to another without creating the product in both departments

                                                                                                              Hello everyone, I am having serious problems with the products. When a customer creates a ticket in a department and selects a product by mistake and we move it to the corresponding department it automatically creates in both departments the product.
                                                                                                            • How do I setup product syncing between Desk and CRM?

                                                                                                              How do I setup product syncing between Desk and CRM? I can see in Desk where to add products, but it doesn't show the existing products I imported into CRM. Where do I turn on the syncing? I assume there's an option somewhere similar to the option to
                                                                                                            • multiple users unable to view campaigns

                                                                                                              I have just added two users to zoho campaigns.  when they log in they don't see the details regarding the email campaigns already run.  i would like all users to access this.
                                                                                                            • If a contact is deleted from Zoho CRM, will all related activities be deleted related to the contact?

                                                                                                              I think question is clear.
                                                                                                            • Factur-X

                                                                                                              Bonjour, J'ai découvert dans la dernière release notes de Zoho Books, l'apparition du support du format Factur-X (Export Transactions in Factur-X Format | Help | Zoho Books), mais il faut apparemment activer une nouvelle fonctionnalité de taxes. Quelqu'un
                                                                                                            • On Duty Requests using API

                                                                                                              Currently we can only do attendance entries using API, we need to make on Duty Requests using API Use Case We are using different on premise devices to track meetings, we want to sync this data with Zoho People Currently we are manually making on duty
                                                                                                            • Zoho desk Instant messaging no notification

                                                                                                              We are using whatsapp inside zoho desk instant messaging, however my agents are not notified if there is someone who send a message. We all miss messages because there is no indication there has been a message send. No notification badge, no notifications
                                                                                                            • need help to set up feeds to Zoho books with CRM Perks plugin

                                                                                                              Hi there, I need help setting up feeds with the CRM Perks plugin. It is supposed to send various feeds, like orders, payments, etc., from Woocommerce to Zoho Books. I have been trying so hard but seem to be too thick to get it done :-( For months, I worked
                                                                                                            • Instagram Visiual Planner

                                                                                                              Hello, I am loving the new updates with Zoho Social, especially the Canva integration. Is Zoho planning to offer the Instagram Visual Planner where you can preview what posts will look like on your timeline grid view before posting? There are many programs
                                                                                                            • How to distribute expenses evenly over the year?

                                                                                                              I want to distribute cost of f.e. licences or inssurance that occour once a year over the year. How can I do this? Is this even possible?
                                                                                                            • Free webinar: Zoho Sign in Q1 2025 - A quick walkthrough

                                                                                                              Hi, The first quarter of 2025 has flown by, and the Zoho Sign team has been hard at work releasing enterprise-grade features to enhance overall collaboration. Join us for our upcoming webinar, where we'll discuss what's new and what's to come. What will
                                                                                                            • How do I make a recurring subtask?

                                                                                                              I have a user that has a monthly task with several subtasks. I can set the main task to monthly recurrence but I've been unable deter how to get the subtasks to transfer with the recurring task. Should I setup tasks with dependency instead?
                                                                                                            • Workflow Failure - Notifications

                                                                                                              Good afternoon, I have just experienced an error whereby a Workflow failed, for a reason currently unknown. The problem is that one of my users had to flag this manually (thankfully he's very thorough) and this otherwise would have flown under the radar.
                                                                                                            • Introducing Linkthread by Zoho Social — our new link in bio tool

                                                                                                              Hey everyone, We hope you're all doing amazing. We always love bringing features and tools to make your social media marketing journey easier, and today, we've got a brand new tool that we'd like to introduce to you. We know how important it is to make
                                                                                                            • Next Page