New built-in functions in Deluge

New built-in functions in Deluge

Hello everyone,

In today's post, let us begin with understanding functions, return values, arguments, and built-in functions. Towards the end of the post we will have a look at some of the newly supported built-in functions.

What are functions?
Functions do exactly what the name suggests. They are used to perform a specific 'function' or a task. Functions are used to combine multiple instructions to form a single piece of code meant to perform an action. And whenever you want to perform that action again, you do not have to write that code again. Instead you can simply 'call' or 'invoke' the function whenever required.
For example, a function can be written to find the average of three numbers. Once the function is created, it can be used as many times required, without having to rewrite the code all over again.

Arguments
The most important part in functions is arguments. Functions take in data in the form of arguments. For example, let's say you need a function that calculates the sum of two numbers. The two numbers could vary at different times. So in one place the numbers could be 10 and 5, in some other place it could be 20 and 25. Simply put, the function is meant to calculate the sum of two numbers which are going to be dynamic. To address this, we can specify two arguments to hold the numbers. Whenever the function is executed, the arguments are simply replaced with the numbers. The operation (in this example the operation 'sum') remains the same as defined in the script.

Argument is just programming jargon for input. Since functions aren't tied to any static or definite data, getting the outside data into your function's script requires arguments. Without arguments, Deluge wouldn't know which data your function should work with. 

Return values
Functions usually "take in" data, process it, and may or not "return" a result. The return is dependent on the script that you write within a function. For example, if you write a script to fetch a record from a specific service, then that function returns the value that has been fetched. If the script simply performs an action, for example if you write a script to add a record to a specific service and you do not want the status or response of the action in return, then that is a function without any return.

Note:
  • Configuring functions, arguments, and their return values depend on the Zoho service you are working on. 
  • We will come up with a central help page covering the working of custom functions in all Zoho services soon. Until then, you can refer to the product documents to learn about configuring custom functions.

Types of Function in Deluge 
In Deluge, functions can either be a user-defined function (custom function), where you decide what scripts are to be written in the function. Or, they could be built-in functions, where the scripts are written by us in the backend, and is readily available for you to use. 

Custom functions
For example, to calculate profit percentage you can create a custom function with the following code snippet. The inputs cost_price and selling_price of a product can be supplied to the function as arguments so the function will process them to calculate the profit percentage. Once the custom function is configured, you can use the same function to calculate profit percentages of different products by passing their cost and selling prices as arguments to this function.

  1. profit = selling_price - cost_price;
  2. percentage = (profit/cost_price)*100;

To trigger a custom function whenever an action is performed, associate it with an appropriate workflow. In Zoho Creator, you can also call the function within another function. 

Note: Configuring workflows to trigger custom functions depends on the Zoho service you are working on. 

Built-in functions
Another type of function that can be used in Deluge is built-in functions. It can be perceived as ready-to-use functions whose actions are pre-defined. That is, the script to perform the action, the required parameters, and the type of return value (if required) are already configured by us. This saves your time and effort as you can simply use them in your Deluge scripts by inputting arguments as expected by the function, without having to write the code.

For example, the leftPad built-in function inserts the specified number of white spaces to the beginning of the input text. This function expects you to supply two arguments specifying the input text and the number of white spaces to be inserted and it returns the padded text. The script required to pad the white spaces has already been written in the backend so you can directly use this function within your custom function. 

  1. lastName = leftpad("Watson",1);
  2. name = "John"+ lastName; // returns "John Watson"

In the above script, "Watson" and 1 are the arguments that are supplied to the leftpad functions and lastName is the variable that holds the return value - " Watson".

Deluge offers around 200 built-in functions so you can perform common actions, like computing the square root of a number, or checking if a given letter is present in a text. Each type of data has its set of built-in functions that allow you to manipulate it.You can refer to our help documents and flashcards to learn more. 

Let's now take a look at the built-in functions that we've recently supported. These functions are applicable for all Zoho services except Zoho Creator. We will eventually support them for Zoho Creator as well. 

Recent updates to built-in functions

Text functions: Functions that work on Text inputs
  • ltrim: Trims the leading white spaces from the given text
  • rtrim: Trims the trailing white spaces from the given text
Consider a concatenation function that will append two text values to return an ID. The following script uses the ltrim and rtrim functions to ensure no white spaces are inserted in between the texts.

  1. generated_ID = first_part.rtrim() + second_part.ltrim();

Here, first_part and second_part are the variables that hold the portions of the ID that need to be concentrated.
generated_ID is the variable that contains the concatenated text.

Number functions: Functions that work on Number and Decimal inputs
  • truncate: Limits the input decimal to the specified number of places to the left or right of the decimal point.
  • signum: Determines if the given number is negative, positive, or zero.
  • degrees: Converts the radians value into degrees
  • radians: Converts the degrees value into radians
  • sinhasinhcoshacoshtanh, and atanh: Perform the respective mathematical hyperbolic operations.
  • atan2: Finds the atan2 value of the specified point.
The following example converts the specified angle to radians and finds its hyperbolic sine value:

  1. angle_in_degrees = 90;
  2. angles_in_radians = angle_in_degrees.radians();
  3. sinh_value = angles_in_radians.sinh();

Here, the angle_in_degrees is the variable that holds the input angle in degrees.

We are working on offering around 70 more built-in functions in the near future. You can keep track of all the new releases, bug fixes, and improvements from our release notes. Do let us know your questions and suggestions in the comments.





    • Sticky Posts

    • Function #41: Sync Associated Subforms!

      Welcome back everyone! The last custom function showed how to update a Contact with Product details from it's Related list in Deals. This week, let's look at a function that lets you update subform records in two modules simultaneously when one of them is updated. Business scenario Let's look at how subform helps in an education institution that has deployed Zoho CRM. National Public School, Austin (made up, of course!) has set up Zoho CRM and it follows the same relationship pattern of "Students",
    • Recent Topics

    • Queries filtered by current page/record

      I have been trying to use the new queries feature, and I can filter the query, but I'm coming unstuck because I don't understand how to make the query dynamically include the filter of the current record. ie if I'm on a deal, to filter all the records
    • Article Numbers for KB articles

      Hello, I was wondering if it's possible to turn on article numbers/ part numbering for KB articles. If this is not already a feature, we'd like to request it. Frequently a solution will require multiple articles so tracking which articles are referenced
    • Zoho CRM API Credits & Limits for Workflow

      Hi Team, Just wanted to clarify how the API credits work for Zoho CRM and workflows with custom functions. API Credits are based on your subscription and are set at the account level. You can buy additional credits if needed. For Enterprise customers,
    • CRM Calendar Sync Not Working

      I can't get any meetings where I am a participant to sync with either Bookings or Office 365. It syncs fine when I am the host, but as a participant, it just ignores the event. I have clients booking meetings when agents are in training or OOO or any
    • How to easy change layout in existing records in Deals?

      Hello, So far i have used only 1 layout in Deals. I have about 1000 records. Now i want to make new layout. So i have 2 layouts: Layout Old (1000 records) Layout New (0 records) How to easy change layout from Layout Old into Layout New for existing records?
    • Change Last Name to not required in Leads

      I would like to upload 500 target companies as leads but I don't yet have contact people for them. Can you enable the option for me to turn this requirement off to need a Second Name? Moderation update (10-Jun-23): As we explore potential solutions for
    • "Copy Field Values from one Module to another" how to use?

      Hi everyone! I'm sorry if this question was already asked, I didn't find it! So let me explain:  In my Tickets module, we have the custome field "customer type" where we indicate if it's a lead, user, etc... In the Contact module I used the "type" field with exactely the same entries. I would like when in the tickets module an operator choose an option that it automatically update it in the contact module. I found the "Copy Field Values from one Module to another" custom function which seems perfect
    • New Leave Type: Compensatory off

      Hi, there is a new Leave Type: Compensatory off. Can someone tell me how to use it, because it sounds it could work for overtime compensation for our techs. Thanks Andreas
    • Introducing bot filtering for accurate analytics

      Dear Zoho Campaigns Users, We're happy to introduce bot filtering to enhance the accuracy of your email campaign analytics. This new feature is designed to help you filter out bot-generated opens and clicks, which will ensure your campaign reports reflect
    • Create custom rollup summary fields in Zoho CRM

      Hello everyone, In Zoho CRM, rollup summary fields have been essential tools for summarizing data across related records and enabling users to gain quick insights without having to jump across modules. Previously, only predefined summary functions were
    • How can I create individual records from a subform

      Hi, I am collecting subform data into a Lead record and I need to create individual records for each row associated to the account when it is converted. How can I do this?
    • Introducing Zia LLM: Zoho’s in-house Generative AI solution for CRM's AI capabilities

      Hello everyone, We're excited to announce the launch of our in-house Large Language Model (LLM) by Zia to power our AI offerings. What is LLM? LLM stands for Large Language Model, a powerful AI technology that processes and generates human-like text based
    • 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.
    • Zoho Desk Validation Rule Using Custom Function

      Hi all, I tried to find the way to validate fields using custom function just like in Zoho CRM but to no avail. Is there a way to do this?
    • Archive Option in Conversation View

      Hello, I have a suggestion\request to add an "Archive Thread" button in conversation view of Zoho Mail. The best suggestion I have is to put an "Archive Thread" button next to the "Label Entire Thread" button in conversation view. Most users don't just
    • Possible to backdate Stage shifts in Deals module?

      I want to enter my organisation's historical dealflow data into the CRM and it's important that the Stage history is showing the correct dates in the past of when it happened. Is there a way for me to modify the "Modified Time" in the Stage History Related
    • Layout Prompt when creating an oportunity

      Hi There, Is there a way to create a pop-up prompt when I create a new Deal giving me the option of what layout to use based on a certain requirement? So, if the prompt had two options 1. is a new business Deal 2. is a renewal Deal Thanks in advance
    • Elevating Email Security on Zoho Desk: DKIM Now Mandatory

      Hello Zoho Desk Users! It has been a wonderful journey with you on Zoho Desk. As we welcome 2025, we are strengthening our efforts to ensure a secure and seamless experience for you. To enhance email security, DKIM configuration will be mandatory for
    • How to upload mass inventory quantity adjustment with batch number?

      I wanted to clean-up our inventory list; however, I have trouble performing the task as I don't know how to mass upload inventory adjustment with batch numbers. I don't want to do it manually as there are if not thousands at hundreds of inventory tr
    • Product sale report with margins

      we unable to get the data as per product sale report with margins so we need help in this
    • Amazon.in FBA multiple warehouse integration with Zoho Inventory

      My organisation subscribed to Zoho One looking at the opportunity to integrate Amazon.in with Inventory. But during the configuration, we understood the integration has severe limitations when it involves multiple warehouses in the same Organisation.
    • CLIENT PORTAL (If clients can place orders directly on the portal)

      Zoho client portal is excellent. Everything is there except one thing. Client should be able to place orders directly on the portal. This would enhance the portal and end users will be extremely happy. This suggestion infact came from one of our client.
    • Is there provision to charge the attendees to join the webinar?

      We want to host some webinar of public interest and want to charge them to participate in this. Does this feature in-build in the application? Offcourse, we will be having Razor pay account activated for these purpose.
    • Zoho Vault App for Windows

      Hello, is there a Windows app that can be used to access the passwords saved in Zoho Vault? Thank you
    • Emails take up to 14 hours to arrive and often never arrive at all.

      I've been on hold on your support phone for two hours. I spent an hour waiting to talk to somebody somebody finally picked up. They asked me to give them my ID number and when I found it, they were gone they didn't hang up. They just walked away from
    • Emails take up to 14 hours to arrive and often never arrive at all.

      I've been on hold on your support phone for two hours. I spent an hour waiting to talk to somebody somebody finally picked up. They asked me to give them my ID number and when I found it, they were gone they didn't hang up. They just walked away from
    • Print PO receipt

      Hi I would like to print the PO receipt. There does not seem to be any way to do this. I track batch numbers and printing the PO does not show this. Only the receipt would show the details of the receipt. Currently I print the screen which does not have
    • "We’ve fine-tuned Zoho Inventory..."

      Every day I have this message at the top of my screen. I hit refresh everyday and then the next I see it again. What is being "fine-tuned" on a daily basis?
    • Checklist/ save to onedrive/ a group of items invoicing in Zoho FSM

      hi, is there a way to add a specific checklist to any WO without passing eachtime by the model customization? can we save file such picture directly in our sharepoint ak onedrive? is there any way to add a group of item pre defined to make invoicing easier
    • How can the direct link to a ticket be created from ticket #?

      Our agents will be using ZDesk but we will have to create direct link to tickets in another ERP by providing the Desk Ticket # Is there a way to create the direkt links from the ticket # alone? Do we have to use the API to get the direct links?
    • Allow standard layout to be used/edited as a starting point for canvas

      Hello, I would really love to improve the look of our CRM interface using Canvas but we have spent so much time customising the screens already (in standard view) that the thought of starting from scratch and building everything again, field by field,
    • How to link to/displaya png stored in workdrive in a Creator HTML snippet?

      How to link to/display png stored in workdrive in a Creator HTML snippet? I've tried it as a plain external link and as an iframe. The iframe works but is kinda slow...and I'd prefer to be able to do finer-grained positioning but referencing the png as
    • Has anyone built a ticket export that allows Help Center users to export the tickets shown in the My Area list they are looking at?

      Hi, We are moving to Zoho Desk soon. Our current support system displays an option in our help center allowing customers to export their Open, Closed, or all tickets based on which list they are looking at. We need to offer the same in Zoho Desk help
    • Contemplating moving my site from WordPress to Zoho Sites

      Hi Everyone, We currently find ourselves in a situation where we ant to review and update our current sites content. We are small business owners, not developers. We currently use a wide range of Zoho products. We sometimes think about the possibility of either moving or just starting from scratch on Zoho Sites. I would like to know if anyone has done this and of course the things that need to be considered. We have spent quite a bit of time getting our current site positioned organically and I guess
    • Set another Layout as Standard

      We created a few layouts and we want to set another one to standard:
    • Using AVG in SQL Query

      My current SQL Query is: SELECT "Client Info", avg("Revenue") FROM "Funded Deals" GROUP BY "Client Info" The current table that this is creating: Client Info avg(Revenue) Previous 4175 1st - New 3411 1st - Old 3013 Renew 3069 While this works as I had
    • Unified customer portal login

      As I'm a Zoho One subscriber I can provide my customers with portal access to many of the Zoho apps. However, the customer must have a separate login for each app, which may be difficult for them to manage and frustrating as all they understand is that
    • Tracking Implementations

      We create Opportunities (Renamed Deals) with associated Quotes (renamed Products and Services). When we close the deal, we want to be able to track the implementation of each product separately. For instance, the client may have ordered Item A, Item B
    • Values in multi pick list are not copied to copied deal

      Hi, After a deal is completed in our sales funnel we copy the deal to an automatically created new deal in our project funnel. All fields are copied properly, but only a Multi Pick List is not copied. How can we copy the selected values in this field
    • Is this link the transparent pixel used to track opens?

      Could someone please help me identify this highlighted link? It is automatically created by Zoho and a lot of contacts receiving campaigns will click on this link. I don't believe that it is the "update your preferences link" because on the Link Clicks
    • Next Page