Troubleshooting in Creator #3: Deluge execution limit optimization

Troubleshooting in Creator #3: Deluge execution limit optimization



Dear developers,

A Deluge statement execution corresponds to each line of code executed within a certain script. The total number of lines executed to complete a certain task on an action like on success is associated with a Deluge execution limit in Creator. To ensure good performance and usability, the number of lines of code executed at a time should be optimized.

Apart from each line of code written under an action, Deluge executions depends on factors such as the use of certain tasks, loops, and functions.

For example, if you're running a for each statement for a form which has 100 records in it, and you have 5 lines of code within the for each, the total number of Deluge statements executed will be 500.

If you have a function call inside the workflow, the number of lines of code in the function will also add up to the Deluge execution limit.

In this post, we'll discuss some simple scripting practices and ways to optimize code executions in Deluge:

Case 1: Using for each tasks
Case 2: Reducing variable definition to store fetched data
Case 3: Avoiding multiple IF statements and using ELSE IF
Case 4: Using built-in functions instead of counter variables



Ways to optimize execution

Case 1: Using for each task

While using for each tasks, we can utilize criteria to control the records through which it iterates.

Example:
  1. for each rec in Form_Name[ID!=0 ] // this will iterate all the records in the form
  2. {
  3. ....
  4. }

Instead, try the below script:

  1. for each rec in Form_Name[field_name=value && field_name2=value2] // this will only be executed for records that satisfy the given criteria
  2. {
  3. ....
  4. }

To iterate through records within a specified range, which meet a criteria, follow the below syntax:
  1. for each rec in Form_Name[<criteria>] range from <start_index> to <end_index>;


Case 2: Reducing variable definition to store fetched data

In some cases, we assign fetched values to a variable and use that variable within the script. If this assignment is done within a for each task, it can increase the Deluge execution. Therefore, instead of this assignment, we can directly use the fetched data in the workflow.

For example:

  1. fet=form[criteria];
  2. a=fet.field1;
  3. b=fet.field2;
  4. input.total=a+b;

Instead, try:

  1. fet=form[criteria];
  2. input.total=fet.field1+fet.field2;




Case 3: Avoiding multiple IF statements and using ELSE IF

When you need to execute a task based on multiple conditional statements, using else if statements can help avoid extra lines of code execution.


For example:

  1. if(a==1)
  2. {
  3. ...
  4. ....
  5. }
  6. if(a==2)
  7. {
  8. ..
  9. ...
  10. }
  11. if(a==3)
  12. {
  13. ..
  14. ...
  15. }

Instead, use:

  1. if(a==1)
  2. {
  3. ..
  4. ...
  5. }
  6. else if(a==2)
  7. {
  8. ..
  9. }
  10. else
  11. {
  12. ..
  13. ...
  14. }


Case 4: Using built-in functions instead of counter variables

Suppose we need to get a sum/count of data for a particular field for a set of records. It's usually done by using a counter variable, as shown below:

  1. ctr=0;
  2. for each rec in Form_name[criteria]
  3. {
  4. ctr=ctr+1;
  5. }
  6. info ctr;


Instead of the above script, we can use our built-in function, count(), as shown below:
  1. 1.fet=form_name[criteria].count(ID);info fet;


Note: The count function in the aggregate records Deluge task returns the count of values (including empty strings) a specified field holds, from records fetched using a criteria.

Now imagine we have to use the record count inside an if statement to execute a particular task, then usually the script used would look something like this:

  1. var=Formname[x=y && z=t];
  2. Var2=var.count(ID);
  3. if(var2>0)
  4. {
  5. ..
  6. ...
  7. }

This can be optimized to:

  1. If (Formname[x=y && z=t].count(ID)>0)
  2. {
  3. ..
  4. ...
  5. }

And we hope that helped! You can find more information about our built-in functions in this help article.


Please let us know how you like this article in the comments below, as well as any other topics you'd like to see us work on. Contact support@zohocreator.com for any further questions.

      • Recent Topics

      • Add a way of clearing fields values in Flow actions

        It would be great if there was an option to set a field as Null when creating flows. I had an instance today where I just wanted to clear a long integer field in the CRM based on an action in Projects but I had to write a custom function. It would be
      • Role Management

        I am creating an analytics dashboard for a company that will be utilized by its various departments such as Finance, Marketing, and HR. My goal is to design the dashboard with separate tabs for each department. Additionally, I plan to implement role-based
      • Highlight a candidate who is "off limits"

        Hello: Is there a way to highlight a candidate who is "off limits"?  I would like to have the ability to make certain candidate and / or Client records highlighted in RED or something like that.   This would be used for example when we may have placed a candidate somewhere and we want everyone in our company to quickly and easily see that they are off limits.  The same would apply when we want to put a client or former client off limits so no one recruits out of there. How can this be done? Cheers,
      • Announcing new features in Trident for Windows (v.1.37.5.0)

        Hello Community! Trident for Windows just received a major update, with a range of capabilities that strengthen email security and enhance communication. This update focuses on making your mailbox safer and your overall email experience more reliable.
      • Early Payment Discount customize Text

        Hi, I’m currently using Zoho Books and am trying to customize the standard “Early Payment Discount” message that appears in the PDF invoice template. I’ve reviewed the documentation here: https://www.zoho.com/books/help/invoice/early-payment-discount.html
      • Deprecation of SMS-based multi-factor authentication (MFA) mode

        Overview of SMS-based OTP MFA mode The SMS-based OTP MFA method involves the delivery of a one-time password to a user's mobile phone via SMS. The user receives the OTP on their mobile phone and enters it to sign into their account. SMS-based OTPs offer
      • Zoho Sheet - Desktop App or Offline

        Since Zoho Docs is now available as a desktop app and offline, when is a realistic ETA for Sheet to have the same functionality?I am surprised this was not laucned at the same time as Docs.
      • DKIM Now Mandatory - Changes to Zoho Forms Email Policies

        Hello Zoho Forms Users, This post is to inform you about an important update regarding the authentication of all email domains in your Zoho Forms account. This year, we are doubling down on our commitment to deliver a secure, seamless, and empowering
      • Call description in notes

        When completing a call, we type in the result of the call in the description. However, that does not show up under the notes history on the contact. We want to be able to see all the calls that have taken place for a contact wihtout having to go into
      • Email Address for Contact not Populating

        When I click "Send Mail" from a Contact's page, their email address does not auto populate the "To" field. How do I make this happen?
      • New in CRM: Dynamic filters for lookup fields

        Last modified on Oct 28, 2024: This feature was initially available only through Early Access upon request. It is now available to all users across all data centers, except for the IN DC. Users in the IN DC can temporarily request access using this form
      • Why hybrid project management might be the best fit for you?

        Project management techniques are designed to equip teams with proven methods for easy and efficient project execution. While management teams may have apprehensions about adopting the hybrid method of project management, we’ve compiled the top reasons
      • Allow all Company Users to view all projects, but only owner/admins can change projects

        I was wondering if there was a permission setting I could adjust to allow all our company users to see all projects created. Then, only the project owners and admins with the change permission. Thanks
      • Fail to send Email by deluge

        Hi, today I gonna update some email include details in deluge, while this msg pops up and restrict me to save but my rules has run for one year. can you tell me how to use one of our admin account or super admin account to send the email? I tried to update
      • Seeking help to be able to search on all custom functions that are defined

        Hello I have a lot of custom functions defined (around 200) and i would like to search some specific strings in the content of those. Is there a way to accomplish that? If not, is there a way to download all existing custom functions in some files locally
      • Totals for Sales Tax Report

        On the sales tax report, the column totals aren't shown for any column other than Total Tax. I can't think of a good reason that they shouldn't be included for the other columns, as well. It would help me with my returns, for sure. It seems ludicrous
      • Add Bulk Section / Grid Layout Duplicate Feature in Zoho Forms Builder

        Currently in Zoho Forms, users can only duplicate individual fields. There is no option to duplicate an entire section or two-column/grid layout with all internal fields. This becomes inefficient when building structured forms such as Family Details,
      • Leistungsdatum in Rechnungen (Zoho Books)

        Hallo, ist es irgendwie möglich den Leistungszeitraum in der Rechnung aufzuführen? Beste Grüße Aleks
      • Zoho Trident Windows - Streams Not Visible

        Namaste We’re having an issue with Streams not being visible in Trident (Windows), which is important for us as we share many emails internally. It appears that the feature to show Streams above the Inbox folder, as seen in the default mailbox view, is
      • Sales IQ Chat Widget is Only Displaying Last Name

        Can anyone suggest why the widget is only displaying "last name"?! We have the latest version of the wordpress plugin installed. Thanks Thanks!
      • Shopify - Item sync from Zoho Inventory

        Hi team, We’ve connected Shopify with Zoho Inventory. We want that when an item is created in Zoho Inventory, it must create a product in Shopify. But currently, new items created in Zoho Inventory are not getting created in Shopify even after clicking
      • Bulk upload image option in Zoho Commerce

        I dont know if I am not looking into it properly but is there no option to bulk upload images along with the products? Like after you upload the products, I will have to upload images one by one again? Can someone help me out here? And what should I enter
      • Is it possible to setup bin locations WITHOUT mandating batch tracking?

        Hi fellow zoho users, I'm wondering if anyone else has a similar issue to me? I only have some products batch tracked (items with shelf life expiry dates) but I am trying to setup bin locations for my entire inventory so we can do stock counting easier.
      • Kill zoho meeting

        Saying the quiet part out loud. Can zoho please just give up on the idea that they can make a meeting platform and just make our workplace licenses cheaper when you remove it so people can switch to zoom or teams. Tired of the excuses, you guys cant make
      • Utilisation de Zoho en conformité avec l’article 286 du Code général des impôts (CGI)

        Cher(e) client(e), Conformément à l’article 286 du Code général des impôts (CGI) impose aux entreprises assujetties à la TVA d’utiliser des systèmes de caisse ou de gestion commerciale certifiés lorsqu’elles enregistrent des ventes à des particuliers.
      • Unable to Create Task as a Support Administrator

        Hello! I want to ask for help regarding creating tasks within the tickets. I am by default the Support Admin. I should be able to create tasks or activities right? But there's a prompt that I need to contact the Administrator. See photos for reference.
      • Introducing Forms in Zoho Sheet

        We hereby bring you the power of ​forms in Zoho Sheet. ​Now, build and create your own customized forms using Zoho Sheet. Be it compiling a questionnaire or rolling out a survey, Zoho Sheet can do it all for you. Forms is an excellent feature that helps you collect information in the simplest of ways and having it in Zoho Sheet takes it a notch higher. Build Simple yet Powerful forms Building forms using Zoho Sheet is fairly simple. The exclusive 'Form' tab lets you create one quickly. Whether you
      • Layout one survey question in a time & redirect next Page based on previous response

        I have doubt while, I am scripting survey on the Zoho where I redirecting to next page based on my previous response but didn’t get success on this. Please help me on this and tell me how I layout one survey questions in a time when I submit response
      • Zoho Bookings form pre-filled with Zoho Forms in

        Hi, I've got a contact page on my website and I'd like to have the option to book an appointment (redirected to zoho bookings page) after an option is submitted on the contact form. how would I go about doing this? thanks
      • Support “Other” Option with Free Text in Dropdown Fields

        Hello Zoho Bookings Team, Greetings, We would like to request an enhancement to the registration form fields in Zoho Bookings, specifically for dropdown fields. Current Limitation: At the moment, dropdown fields do not support an “Other” option that allows
      • ZOHO add-in issue

        I cannot connect ZOHO from my Outlook. I am getting this error.
      • Sending automated messages that appear in the ticket's conversation thread

        Good morning, esteemed Zoho Desk community, warm greetings Today I am here to raise the following problem, seeking a solution that I can implement: I need to implement an automation that allows me to send reminder messages to customers when I am waiting
      • Introducing parent-child ticketing in Zoho Desk [Early access]

        Hello Zoho Desk users! We have introduced the parent-child ticketing system to help customer service teams ensure efficient resolution of issues involving multiple, related tickets. You can now combine repetitive and interconnected tickets into parent-child
      • Payment Card or Identity form-fill from Vault?

        Hello! I'm working on replacing Bitwarden with Vault and one issue I've run into is that I can't find any option to fill address and payment forms from Payment Card or Identity info that has been saved in Vault. Is there a way to do this? Is it a planned
      • Ability to add VAT to Retainer Invoices

        Hello, I've had a telephone conversation a month ago with Dinesh on this topic and my request to allow for the addition of VAT on Retainer Invoices.  It's currently not possible to add VAT to Retainer Invoices and it was mutually agreed that there is absolutely no reason why there shouldn't be, especially as TAX LAW makes VAT mandatory on each invoice in Europe!   So basically, what i'm saying is that if you don't allow us to add VAT to Retainer Invoices, than the whole Retainer Invoices becomes
      • Time Log Reminder

        Tracking the time spent on tasks and issues is one of the most important functions of a timesheet. However, users may forget to update the time logs because they have their own goals to achieve. But, time logs must be updated at regular intervals to keep
      • [Early-access] Introducing Zoho's CommandCenter - Cross-Zoho business process automation

          Resources to help Webinar recording | Documentation  Feature Restrictions Currently available on early-access only for US data center accounts Features Role CommandCenter as a Service uses signals across Zoho services to propel the movement of records
      • Tip #58- Accessibility Controls in Zoho Assist: Learning- 'Insider Insights'

        Learning should be clear and interruption-free for everyone. Timely feedback plays an important role in helping users understand actions as they happen, without breaking their focus. In this post, we’ll explore the final section of Accessibility: Learning.
      • ZIA "Generate Content" action doesn't have contexual data from the ticket

        "Generate Content" action doesn't have contexual data from the ticket. I try to get AI to help me with this ticket but it doesn't seem to have any ticket information as context. Although the ticket has a lot of information in it.
      • Zoho Desk - Zoho FSM Integration issue on Mobile and iPad

        Hello Team, I am trying to create a Work Order (WO) using the Zoho FSM integration (Add-on Service) that is integrated with Zoho Desk. The issue is that the integration is not working on mobile devices and iPads. While I am able to create the WO, Request,
      • Next Page