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.





    Access your files securely from anywhere


            Zoho Developer Community




                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day



                                          Zoho Marketing Automation
                                                  • 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",


                                                  Manage your brands on social media



                                                        Zoho TeamInbox Resources

                                                          Zoho DataPrep 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

                                                                                                  • Schedule Zoho CRM reports only on Business Days

                                                                                                    Hello, Is it possible to schedule reports only on business days ? We currently get daily sales reports on weekend which has no value since the sales team doesn't work on weekends. Thanks
                                                                                                  • Zoho Payroll's Year in Review 2024

                                                                                                    As we roll into 2025, we'd like to pay tribute to all the milestones we hit in 2024! From releasing out new features that streamlined your workflows to updates that made payroll management smoother, we’ve had a prolific year—all while keeping you, our
                                                                                                  • Using tickets to train Zia

                                                                                                    Hi Team, I would like to know if there is any way that Zia can also learn from previous tickets in addition to the articles from the knowledge base. Since we have most of our knowledge curerently in the tickets and that this is hard to combine into a
                                                                                                  • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

                                                                                                    We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
                                                                                                  • Easy way to delete attachments

                                                                                                    I've reached my data limit and would like to run a view/report, and mass delete attachments. Is there an easy, fast way to do this? Moderation Update: Post Summary: There are two features the post discusses a) Easy way to remove Email attachments Will
                                                                                                  • 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?
                                                                                                  • Multiplying Weight of product by Quantity

                                                                                                    I am facing an issue with creating a report that consolidates the total sales volume in kilograms. I have already specified the weight for each product. I have also aggregated the total sales quantity. The key question is: how can I create a report that
                                                                                                  • Confirmation prompt before a custom button action is triggered

                                                                                                    Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
                                                                                                  • Frontal interview scheduling - room availability in office using Google Workspace?

                                                                                                    Hi, We're using Zoho Recruit as our ATS and Google Workspace as our email, calendar and resources management. We want to use the interview feature to schedule an in-person (frontal) interview with the applicants. How can we sync the room resources availability
                                                                                                  • Add and Remove Agents from Departments and Groups in Zoho One

                                                                                                    Hi Zoho Flow Team, We hope you're doing well. Currently, Zoho Flow provides an action to add an agent to a group in zoho one, but there is no action to remove an agent from a group or a department. Another action that we find missing is the option to
                                                                                                  • Explication sur comment mettre en place des règles d'affichage ou "layout Rules"

                                                                                                    J'ai passé plus d'une heure hier avec le support et je n'ai rien compris !! Je suis lecteur assidu des guides (je "RTFM") qui ne sont absolument pas orienté "client" chez Zoho, et je tiens à le rappeler ici . Dans la documentation on m'indique un cas
                                                                                                  • Introducing Hiring Pipeline for Vendor Portal

                                                                                                    Keeping vendors informed about candidate progress is often challenging, leading to communication gaps and repeated follow-ups. To address this issue, we've released an update to the Vendor Portal feature that lets you choose to display candidates' hiring
                                                                                                  • Unlocking New Horizons: A Year in Review

                                                                                                    As we bid farewell to 2024, let's celebrate and revisit the key highlights of the year. From adding a new edition to cross-platform enhancements, here’s a roundup of all the feature updates designed to simplify accounting, optimize financial management,
                                                                                                  • Free user licenses across all Portal user types

                                                                                                    Greetings everyone, We're here with some exciting and extensive changes to the availability of free user licenses in CRM Portals. This update provides users with access to all Portal user types for free to help them diversify their user licenses and explore
                                                                                                  • Address Grabber function for Zoho

                                                                                                    I converted from ACT to Zoho. With ACT, I used an add-on called AddressGrabber to scrape the contact information from leads that I buy and contact information contained on emails and websites and directly add it as a new lead or contact. Does anyone know
                                                                                                  • Integrate zoom with zoho bookings please; or add optional times in zoho meetings

                                                                                                    Just like events - these online meetings like zoom need to be integrated with zoho bookings, and there needs to be option for customer to book a time slot. It should not be dictated by CRM user.
                                                                                                  • Add Owner to deluge-created module record note

                                                                                                    Is it possible to include the "owner" aka "creator", of a Note when creating it via delulge? This sets "superadmin" as the Note creator. I need to override it. notemap = Map(); notemap.put("Parent_Id",program_contact_id); notemap.put("Note_Content",program_contact_data.get('Note'));
                                                                                                  • Directly Edit, Filter, and Sort Subforms on the Details Page

                                                                                                    Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
                                                                                                  • Dialing Microsoft Teams Phone Service via Zoho CRM

                                                                                                    I am using the VOIP option in Microsoft teams for my office phone system. I was hoping to have a way to dial numbers directly from Zoho CRM, but don't see anything in the Teams Integration or in the Telephony integration that will enable this. Does anyone
                                                                                                  • Custom "Filter By" in Client Portal

                                                                                                    Currently our client portal only shows items for that specific person that is logged on to the portal, we want the current logged user to see all items for that user's company. An example would be invoices, so the current user would see all invoices for
                                                                                                  • Unique and Random IDs in Zoho Forms: Organize and Secure Your Data Efficiently

                                                                                                    When it comes to form submissions, organizing and identifying entries effectively is crucial. Zoho Forms offers two versatile ID generation options for submissions: Unique ID and Random ID. Each serves distinct purposes, providing flexibility to meet
                                                                                                  • Why wont Zoho Support Grammarly!! --- PLEASE VOTE FOR THIS to show Zoho we need this

                                                                                                    The spell check and grammar in ZOHO are so buggy and a waste of time. Please support Grammarly! I'm sure I'm not the only one — there are other CRMs that support this. If you're not planning to add this feature, Please let others know before accepting
                                                                                                  • Sort By Date - Deluge

                                                                                                    I have the following code, which normally works to sort calls by created time. Every once in a while, it doesn't work and something sneaks through in the wrong order and I can't figure out why. calls = zoho.crm.searchRecords("Calls","(Owner:equals:" +
                                                                                                  • Webhook when estimate is refused is not firing

                                                                                                    Hello, I use a workflow through make that sends estimate with zoho books (I paid books and sign). -Those estimates when accepted are firing the webhook that I create in zoho sign (photo 1) -However when refused they are not firing the webhook that I created
                                                                                                  • Iteration through a list - Coming up against a "Failure to update function" error

                                                                                                    Hi there! I've been attempting to get a deluge script working and am running into an error that I have been unable to resolve. The error I am getting is Failed to update function Error at line :18. Improper Statement. Error might be due to missing ';'
                                                                                                  • Error 403: Forbidden When Updating Email Signature via API

                                                                                                    Hi Zoho Desk team, First, congratulations again on the excellent Zoho API. But, I’m encountering an issue while attempting to update an email signature via the API. Whenever I make a request to update the signature, the response returns an HTTP 403 Forbidden
                                                                                                  • Can you modify "Last Activity Time" in deluge? If so what's the field name?

                                                                                                    I need to perform some bulk modifications on records in the Leads module, but I need to avoid changing the "last activity time" or "date modified" because I am using those fields to filter and sort leads for follow-up action. I cannot find an answer anywhere
                                                                                                  • How do I define a weekend

                                                                                                    I noticed the default for weekends does not seem to include Saturdays. How can i define weekends to include both Saturdays and Sundays? Thank you.
                                                                                                  • 【Zoho CRM】ポータル機能のアップデート

                                                                                                    ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中からポータル機能のアップデートをご紹介します。 今回の機能アップデートにより、CRMのポータルへのログインがより簡単にできるようになりました。 【目次】 SAMLベースのシングルサインオンについて ポータルへのアクセスリンク送付について 今回のアップデートにより、アイデンティティプロバイダー(IdP)を利用している組織において、SAMLベースのSSO(シングルサインオン)を有効化できるようになりました!
                                                                                                  • Getting error during inserting a record in form of zoho people using zoho api

                                                                                                    import requests import json # Set your access token and Zoho People API base URL access_token = '1000.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX' api_base_url = 'https://people.zoho.in/people/api/' # Set the form name and data to be inserted form_link_name
                                                                                                  • UI Arabic

                                                                                                    can i change the member portal UI to arabic in zoho community?
                                                                                                  • How do i remove the Powered by Zoho logo from my careers page

                                                                                                    Can I remove this? ​
                                                                                                  • Canvas View in Zoho Recruit

                                                                                                    Is it possible or would it be possible to have the new 'Canvas View' in Zoho Recruit?
                                                                                                  • Resume template to include profile photo

                                                                                                    Hi, We would love the Resume Template to be able to include their profile photo. How can this be done? Miriam
                                                                                                  • Marking a form as 'done'?

                                                                                                    Hi! I've got a form that staff fill in when moving stock from location to location. I see the entries they've sent across and I input them into my stock control system. Is there a way to mark a form as 'done'? So that I know which entries I've input,
                                                                                                  • 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
                                                                                                  • Zoho CRM - best way to search an account and assign to a deal

                                                                                                    Hi Everyone I am looking for some advice. I want to find the best way to complete the below steps. We have a deal and once it reaches a certain stage we need to allocate a supplier / vendor to this deal along with the salesperson. I want to add (ideally
                                                                                                  • Emailing lookup field but placing this as an ID or number rather than text

                                                                                                    Hi there, First time poster and have been a user of Zoho Creator for approx 6weeks so forgive my ignorance as I learn to code. We have a need to send an email to a specific email address with some of the fields triggered by the submission of a form. In
                                                                                                  • Count the NUMBER of Contacts for an Account automatically

                                                                                                    Hello. Is there any way Zoho can count the number of CONTACTS for a particular ACCOUNT and have a field in the ACCOUNT module update itself automatically? Currently we use Zoho to administer our language school and the Contacts represent students and Accounts represent Grupos (Classes). It would be very useful for us to have a feature like this enabled, and I can see other similar applications requiring something like this. The solution would be even better if the Contacts met a specified criteria,
                                                                                                  • 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?
                                                                                                  • Next Page