Tip 2: Recursive functions in Deluge: How to dynamically run a function for a specified number of times.

Tip 2: Recursive functions in Deluge: How to dynamically run a function for a specified number of times.



Hi folks,

As part of the Zoho Creator - Tips and Tricks series every fortnight, we are back today with a new tip on Recursive functions. 

Let us first quickly understand what Recursive functions are: A function that calls itself one or more times is known as a Recursive function. That is, you can execute a function to perform a particular action a specific number of times. And, at the end of each iteration, a new output is generated.

Recursive functions are commonly used by programmers as it enables them to write efficient programs with minimal lines of code.

Here are few other use cases where you need to use Recursive functions in Zoho Creator:
  • Duplicating a record for 'n' times.
  • Calling a CRM function 'n' times to fetch all the records from Zoho CRM.
  • Iterate one HTML view 'n' times with incremented date.

Usually, other programming languages include iterative loops like For loop and While l
oop to perform this kind of actions. While those loops are not yet supported in Zoho Creator, we can still execute a function. It will be based on records in the form, and not on user-specified values.

Now, let's look at another example: 

Let's say we have a form with a Number field. While submitting a new record we key in a value 'n' in that Number field. Now, let's see how to duplicate this record 'n' times on submission of the form.

To perform this action we will need to create a Recursive function like the one below:


  1. // create a function called DuplicateNtimes
  2. void DuplicateNtimes(int n)
  3. {
  4. //insert the task to duplicate record 
  5. insert into <form>
  6. [
  7.       <field> = <expression>
  8.       <field> = <expression>
  9.       <field> = <expression>
  10. ]
  11. if(n-1 >= 1)
  12.     {
  13.                 DuplicateNtimes(n-1);
  14.     }
  15. }
  16. DuplicateNtimes(input.NumberField);


Note: The number of times this loop can run is based on the number of lines in the code. Our Deluge limit is 5000 lines per execution. So the loop might end or abruptly close after reaching the limit.


Hope you got a fair idea on how to use Recursive functions to perform different actions. Keep watching this space for more such tips.


 

 






    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner






                                                            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 - Gocardless sales receipts

                                                                                                              I've been using gocardless for years and have d/d mandates set up on there. Each week we get bulk payments from customer d/d's. However, we need to send sales receipts to these customers. So I know I can sync mandates into Zoho, and then I can set up
                                                                                                            • Introducing Rollup summary in Zoho CRM

                                                                                                              ------------------------------------------Moderated on 5th July'23---------------------------------------------- Rollup summary is now available for all organizations in all the DCs. Hello All, We hope you're well! We're here with an exciting update that
                                                                                                            • Introducing Connected Workflows in Zoho CRM for Everyone : Free Your Teams to Focus on What Matters

                                                                                                              Hello Everyone, We’re thrilled to introduce the next big evolution in Zoho CRM for Everyone -- Connected Workflows. This new feature builds on our commitment to deliver a CRM that’s truly inclusive, adaptable, and designed for consistent collaboration
                                                                                                            • Introducing Connected Records to bring business context to every aspect of your work in Zoho CRM for Everyone

                                                                                                              Hello Everyone, We are excited to unveil phase one of a powerful enhancement to CRM for Everyone - Connected Records, available only in CRM's Nextgen UI. With CRM for Everyone, businesses can onboard all customer-facing teams onto the CRM platform to
                                                                                                            • Cooling-off Period Just Got Better: More Coverage, More Control

                                                                                                              We’ve enhanced the Cooling-off Period feature in Zoho Recruit to give you more control over repeat applications and referrals. This helps you maintain a cleaner, more efficient recruitment pipeline. With this enhancement, you can: Prevent duplicate candidate
                                                                                                            • Cliq iOS can't see shared screen

                                                                                                              Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                                                                                            • Revenue Management: #7 Revenue Recongition in Construction & Real Estate Industry

                                                                                                              If you are in the construction or real estate business, you are used to long project timelines and progressive invoicing to keep up with your billing. But when does revenue get recognized? Will it happen when the contract gets signed? At different milestones
                                                                                                            • TikTok (and other social platform) Messages and comments of the past

                                                                                                              When I link a social channel, Zoho will show in "Inbox", "Messages" and "Contact" sections the interaction done in the past? (comment, messages...)
                                                                                                            • Email Integration - Zoho CRM - OAuth and IMAP

                                                                                                              Hello, We are attempting to integrate our Microsoft 365 email with Zoho CRM. We are using the documentation at Email Configuration for IMAP and POP3 (zoho.com) We use Microsoft 365 and per their recommendations (and requirements) for secure email we have
                                                                                                            • How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.

                                                                                                              How do I fix this? Unable to send message; Reason:554 5.1.8 Email Outgoing Blocked.
                                                                                                            • Restrict Employee mail deletion

                                                                                                              Dear Zoho, Is there a way where i can restrict my employees to delete any mails from their account
                                                                                                            • 554 5.1.8 Email Outgoing Blocked.

                                                                                                              Hi guys, I just singed up for mateusz.nowicki@zoho.com mail and I can't send any mails.. Why? Everytime I try to send something I got error like the one in the screenshot. Please, help me.
                                                                                                            • Zoho IP blocked by SpamHaus

                                                                                                              ERROR CODE :550 - 5.7.0 Your server IP address is in the SpamHaus SBL-XBL database, bye
                                                                                                            • File Upload in Creator's Subfrom

                                                                                                              Hello Sir/Madam, Here is a Problem......... Scenario: In CRM One Custom Module (Payments) have one File Upload Field now we have to Upload that File into Creator's Custom Form (Documents) have one Subform (Documents) in Document Upload Field using Deluge
                                                                                                            • integarting attachments from crm to creator

                                                                                                              when i tried to integrate pdf attachments from crm to creator via deluge i am getting this error {"code":2945,"description":"UPLOAD_RULE_NOT_CONFIGURED"} the code i used is attachments = zoho.crm.getRelatedRecords("Attachments","Sales_Orders",203489100020279XXX8);
                                                                                                            • Error AS101 when adding new email alias

                                                                                                              Hi, I am trying to add apple@(mydomain).com The error AS101 is shown while I try to add the alias.
                                                                                                            • Trigger workflow base on email clic

                                                                                                              Searching the help and forum, I see that there were workflow trigger rules based on email. But now, I can't find this type of trigger when I create a custom workflow. What I'm looking for would be to automate the sending of an email for a new prospect,
                                                                                                            • Bigin Form Acknowledgement

                                                                                                              How to troubleshoot and find out why form acknowledgement is not sending emails after form submission?
                                                                                                            • Option to Customize Career Site URL Without “/jobs/Careers”

                                                                                                              Dear Zoho Recruit Team, I hope you are doing well. We would like to request an enhancement to the Career Site URL structure in Zoho Recruit. In the old version of the career site, our URL was simply: 👉 https://jobs.domain.com However, after moving to
                                                                                                            • Zoho Mail POP & IMAP Server Details

                                                                                                              Hello all! We have been receiving a number of requests regarding the errors while configuring or using Zoho Mail account in POP/ IMAP clients. The server details vary based on your account type and the Datacenter in which your account is setup. Ensure
                                                                                                            • Ever since the new Android App udpates notifications are not working

                                                                                                              notifications are not working for the app is its closed I followed the tutuorial to the notificaction fixed and everythig seems to be right but notifications are not workig
                                                                                                            • Zoho Analytics & Zoho Desk - but not all desks

                                                                                                              I have several desks in our company and one of those is used by our HR department. I want to bring through the data to the shared Zoho Analytics workspace - except for the HR desk. Can this be excluded at data import stage ?
                                                                                                            • Incoming Emails Not Showing Up in Zoho Inbox

                                                                                                              Hi - I have my Zoho email account set up to forward a copy of all incoming emails to a secondary Gmail address, whilst retaining the original email in the Zoho inbox. However, all my incoming emails are currently not showing up in my Zoho inbox, so I'm
                                                                                                            • Form Accessibility

                                                                                                              Hi, is there an update on the accessibility standard of Zoho forms? Are the forms WCAG 2.1 AA compliant? 
                                                                                                            • How to retrieve my following requests on this forum?

                                                                                                              Sorry, but I did not find the proper subforum for this question.
                                                                                                            • How to list emails in a folder, e.g. Inbox, on multiple pages when using Zoho mail webpage?

                                                                                                              Something as shown in the figure. There are totally 50 emails in Sent folder. If "Mail per page" equals 20, then the Sent folder is split into 3 pages. When I wander through Sent folder, I can just select a specific page to jump to. BTW, it seems that
                                                                                                            • Unable to Create Zoho Booking via the Book Appointment API

                                                                                                              Its giving the below error {     "response": {         "errormessage": "Error setting value for the variable:customer_details\n null",         "status": "Error"     } } Request: POST Url: https://www.zohoapis.in/bookings/v1/json/appointment attached Zoho-oauthtoken
                                                                                                            • SHEET - Send email when a cell changes

                                                                                                              I would like to create a custom function for Zoho Sheet that triggers when a paticular cell changes to a specific value. This would result in sending an email to a recipient (this would be an address that remains the same and included in the script). Example: = IF(N4= "Drafted", <>EmailFunction) 1)     Cell N4 changes to "Drafted" 2)    Email is sent to recipient            or alternatively 3)    Post to chat channel I have found the Custom function editor in Sheet. I am not bad at scripting, but
                                                                                                            • 【開催報告】 福岡 ユーザー交流会 2025/8/8(金)

                                                                                                              皆さま、こんにちは。コミュニティチームの中野です。 8/8(金)に、福岡 ユーザー交流会を開催しました。 本投稿では、その様子をお届けします。当日の登壇資料などもこちらに共有しますので、参加できなかった皆さまもご参照ください。 今年初の開催となる福岡 ユーザー交流会では、CreativeStudio樂合同会社 前田さんによるZoho CRM / Sign / Survey の事例セッションのほか、 Zoho社員セッションでは、Zoho Forms の活用法を解説。 さらに、「見込み客・顧客データの管理/活用方法」をテーマに参加者同士でZoho
                                                                                                            • hiding a topic from all but one segment (or list)

                                                                                                              My organization sends out a number of newsletters using Zoho Campaigns. One of those newsletters is for volunteers. In order to become a volunteer, a person has to first go through our volunteer orientation (training). After that, they can receive newsletters
                                                                                                            • no me llegan los correos a Zoho mail

                                                                                                              No puedo recibir correos pero sí enviarlos, ya hice la modificación de MX y la verificación de teléfonos, qué es lo que ocurre? gracias
                                                                                                            • Error: Invalid login: 535 Authentication Failed

                                                                                                              I have used zoho with nodemailer. const transporter = nodemailer.createTransport({ host: 'smtp.zoho.com', port: 465, secure: true, auth: { user: 'example@example.com', pass: 'password' } }); While sending the mail, it shows the following error: Error:
                                                                                                            • Zoho Renewal

                                                                                                              Hello, If I am not going for zoho email renewal. will i get back my free zoho account? and if yes then is it possible to get back my all free user. how many user get back 10 or 25?
                                                                                                            • javax.mail.authenticationfailedexception 535 authentication failed

                                                                                                              Hi, I am facing 535 authentication failed error when trying to send email from zoho desktop as well as in webmail. Can you suggest to fix this issue,. Regards, Rekha
                                                                                                            • Not reciving emails

                                                                                                              Apparently i cannot recive emails on my adress contact@sportperformance.ro I can send, but do not recive. The mail i'm trying to send from mybother adress gets sent and doesn't bounce back... but still doesn't get in my inbox. Please advise
                                                                                                            • Not receiving MailChimp verification e-mail

                                                                                                              It seems that their verification e-mails are blocked. I can receive their other e-mails, but not their verification of domain ownership e-mail. I've checked and double checked how I typed the e-mail, using different e-mails (my personal e-mail can receive it), white listing the domain and all that is left is for the IP's to be white listed, but I don't have that power.  If a staff member could take a look at this -> http://mailchimp.com/about/ips/ And perhaps white list them for me, that would be
                                                                                                            • Creating my 2nd email account

                                                                                                              After creating my first email address, I decided to get another email address. I would like to use this new address as the primary address too. I don't know how to set it up there doesn't seem to be an option for that
                                                                                                            • Cannot - create more email account - Unusual activity detected from this IP. Please try again after some time

                                                                                                              Hello, I come across the error message in Control Panel. Unusual activity detected from this IP. Please try again after some time and i cannot create any more users We are an IT company and we provide service for another company Please unlock us.
                                                                                                            • "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain"

                                                                                                              Good day. When I try to send mail through ZOHO mail I get the following error : "Unable to send message;Reason:553 Relaying disallowed. Invalid Domain" I need help with this. My zohomail is : @eclipseweb.site Thank you,
                                                                                                            • Transfert de domaine pour création des comptes emails

                                                                                                              Bonjour , je ne parviens point à créer des mails avec le domaine 'raeses.org' suite à la souscription du domaine auprès d'un autre hébergeur, dont j'ai fait la demande du code de transfert qui est le suivant : J2[U8-l0]p8[ En somme, attente de l'activation
                                                                                                            • Next Page