Episode I : Exploring the World of Custom Functions in Zoho Desk

Episode I : Exploring the World of Custom Functions in Zoho Desk


Hello Again!
Welcome to an Automation Adventure in the World of Zoho Desk
Join us on a journey to explore how custom functions can enhance and extend the capabilities of Zoho Desk.
Automation is everywhere. From robotic arms assembling products on factory floors to automating tasks in the software world, automation has revolutionized how we work out stuff. But what does this have to do with Zoho Desk? 
Anline, a curious resident in the Zoho Desk world, is exploring how automation can transform her workflow.

Anline’s Quest in the Zoho Desk World  

Anline is building her own world within Zoho Desk, but she’s hit a few roadblocks. She wants to perform specific operations; like updating ticket statuses, fetching data from external services, and automate repetitive tasks. She knows Zoho Desk has the tools she needs, but where does she start?
DeskAutomate Services is here as a guide to the Automation City. The citizens of Zoho Desk World operate based on their licenses. Each license unlocks different levels of automation capabilities.
Anline has the Enterprise edition, which grants her the access to the most powerful tools: Custom Functions. How can this empower Anline?

The Power of Custom Functions  

Custom Functions are like magic spells in the Zoho Desk world. They give users flexibility to tailor automation to their exact needs. While basic automation features are available to all license holders, Custom Functions are exclusive to Enterprise users. These functions let Anline go beyond the basics and create automations that meet her unique requirements. What makes them even more accessible is Deluge, Zoho’s in-house scripting language.
But there’s a catch: Anline isn’t a coding expert in Deluge. How can she harness the power of Custom Functions without getting lost in complex scripts? DeskAutomate guides Anline to the prebuilt functions and a user-friendly framework, simplifying the coding process.
Whether you’re new to coding or an experienced developer, Deluge simplifies the process of creating Custom Functions with its intuitive interface and drag-and-drop functionality.

The Deluge Script Editor: Your Coding Playground  

To access the Custom Function window, go to Setup (S) >> Developer Space >> Functions >> New Function.
When you open the Custom Function window in Zoho Desk, you’ll find a user-friendly interface designed to help you build scripts using drag-and-drop options. Here’s what you’ll discover: Each section has predefined variables which you can drag and use based on your requirements.
1. Basic Commands
The Basic section includes essential commands like setting variables, adding comments, and inserting informational text into your script. These foundational elements help you structure your Custom Function logically.
          Example: businessDaysCount = 5; //<variable> = <expression>;
2. Conditional Logic
The Condition section allows you to add conditional operators such as if, else if, and else. These operators let you program decision-making logic into your Custom Function.
Example:
  1. if (TicketStatus == "Open")
  2. {
  3.     info "This ticket is still open.";
  4. }
3. Notifications
The notifications section lets you enter values to send emails or post messages via Cliq.
Example:
  1. sendmail
  2. [
  3. from : zoho.userid
  4. to   : support@zylker.com
  5. subject : "Ticket is created"
  6. message : "Thank you for your enquiry. A ticket has been created and our experts will respond to you."
  7. ]; 
4. Integrations
Zoho Desk makes coding easy for integrations. With drag-and-drop options, you can create webhook integrations and API calls without writing complex code from scratch. The Custom Function window provides all the necessary code snippets, so you can customize them to fit your requirements.
Example: contactRecord = zoho.crm.getRecordbyId("Contacts",9876787);
5. Collections
The Collections feature lets you gather and manage strings of data or specific information within your Custom Function. This is particularly useful when you need to process or analyze multiple data points.
Example:
  1. myList = Collect();
  2. myList.insert("ID1");
  3. myList.insert("ID2");
  4. myList.insert("ID3");
  5. for each ID in myList
  6. {
  7.    info ID;
  8. }
You can also enable the Syntax Builder within your Coding playground. Enabling this option will help you choose variables from the drop-down windows having prebuilt variables/Fields.

Mapping Parameters and Testing Your Script  

Once you’ve built your Custom Function, the next step is to map it to your Zoho Desk environment:
1. Edit Arguments
The Edit Arguments option lets you map params within your Custom Function to fields in your tickets. For example, you can link the Ticket ID, Ticket Owner, or Case ID to the corresponding fields in your Zoho Desk setup. This ensures that your Custom Function interacts seamlessly with your data.
2. Authentication and Connections
Zoho Desk uses OAuth tokens to establish secure connections for Custom Functions. Commonly, this involves using Zoho OAuth to make API calls within Zoho's scope. You can choose the appropriate scopes during authorization to ensure your Custom Function has access to the necessary data and functionalities.
Note: If you choose third-party applications, please create a connection using the required default or custom services.
3. Save and Test
After saving your script, use Save & Execute Script to test it with sample inputs. This lets you test the function, ensuring functionality, debug, and refine your code before deployment.
In the upcoming episodes, we'll dive into how Custom Functions work and contribute to expanding the capabilities within Zoho Desk.
See you in the next episode,
Regards,
Lydia | Zoho Desk. 

      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Register for Zoho Desk Beta Community

            With the start of the year, we have decided to take a small step in making the life of our customers a little easier. We now have easy access to all our upcoming features and a faster way to request for beta access. We open betas for some of our features
          • Share your Zoho Desk story with us!

            Tell us how you use Zoho Desk for your business and inspire others with your story. Be it a simple workflow rule that helps you navigate complex processes or a macro that saves your team a lot of time; share it here and help the community learn and grow with shared knowledge. 
          • Tip #1: Learn to pick the right channels

            Mail, live chat, telephony, social media, web forms—there are so many support channels out there. Trying to pick the right channels to offer your customers can get pretty confusing. Emails are most useful when the customer wants to put things on record. However, escalated or complicated issues should not be resolved over email because it's slow and impersonal.  When you need immediate responses, live chat is more suitable. It's also quick and convenient, so it's the go-to channel for small issues. 
          • Welcome to Zoho Desk Community - Say hello here!

            Hello everyone! Though we have been here for a while, it’s time to formally establish the Zoho Desk Community; we’re really happy to have you all here! This can be the place where you take a moment to introduce yourself to the rest of the community. We’d love to hear all about you, what you do, what company or industry you work for, how you use Zoho Desk and anything else that you will like to share! Here’s a little about me. I am Chinmayee. I have been associated with Zoho since 2014. I joined here
          • Webinar 1: Blueprint for Customer Service

            With the launch of a host of new features in Zoho Desk, we thought it’ll be great to have a few webinars to help our customers make the most of them. We’re starting off with our most talked about feature, Blueprint in Zoho Desk. You can register for the Blueprint webinar here: The webinar will be delivered by our in-house product experts. This is a good opportunity to ask questions to our experts and understand how Blueprint can help you automate your service processes. We look forward to seeing

          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

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

                              Zoho CRM コンテンツ






                                ご検討中の方

                                  • Recent Topics

                                  • Cannot delete old accounts

                                    Hello, I try to delete old accounts from CRM, but it won't permit, saying documents are still linked to them. I searched in CRM and BOOKS, found some documents and deleted them, but still CRM won't delete them. Any idea how to do that ? I have a lot of
                                  • Low Stock View

                                    We use the Low Stock view frequently as a guide to inform us when to reorder items, but the view is misleading because it does not take into account Purchase Orders that have already been raised. Unless you are aware and check item by item, this can lead
                                  • Client Script | Update - Introducing Subform Events and Actions

                                    Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
                                  • Multi Line Text Character Limit

                                    I want to export my Help Center articles but I realized that the text in the Answer column is being cut off. I'm guessing there is a character limit for multi line text fields. How can I get around this?
                                  • blank page after login

                                    blank page after logging into my email account Thanks you
                                  • Zoho Projects - Custom Objects

                                    Hello, is there the ability now, or in the near future, to add custom objects to Zoho Projects? The requirement here would be to have the ability to track change requests to a project's budget. The idea here is to have the ability to create a custom Object
                                  • Whats App Automation

                                    It would be nice to be able to send out an automated whats app message template on moving stages or creation of a ticket (same as you can do for automated emails). Currently only automated emails can be sent. Also, if whats app could be used more effectively
                                  • Access CRM Variables from Formula field

                                    Is it possible to use a CRM variable (defined in Developer Space -> CRM Variables) in a formula field for calculations ?
                                  • Zoho Campaigns to Zoho Analytics Sync Fails – Field Mapping Shows But Not Applied

                                    I’m facing a persistent issue with the Zoho Campaigns integration to Zoho Analytics in my workspace. Here’s a detailed description of the problem: Under Edit Setup, I see a field mapping summary that shows: DataField Mapping: Most Recent Login However,
                                  • Customising Sign Up Page in Zoho Help Centre Sandbox

                                    Hi, I would like to customise the Sign Up page in my Help Centre Sandbox Environment but when I try to access it I get this message: What setting or permission do I need to achieve this? Many thanks, Kunal
                                  • Announcing Bigin India Meetups Across 8 Cities: July 29 - Aug 07

                                    Hello Biginners, We've got some exciting news to share! We're hosting our first round of Customer Meetups for 2025 in India, from 29th July - 9th August. Whether you're a Bigin newbie or a seasoned pro, this is your chance to meet customers from your
                                  • Why isn't there an Expense description field / column?

                                    Hello! I'm new to Zoho Books and accounting. I'm surprised there isn't a proper expense description field (and column in the overview "all expenses" page)? I thought this was a given in accounting, as visualizing expenses facilitates tracking them down?
                                  • New in Zoho PDF Editor: Watermarks, password protection, signature collection, and more.

                                    Hi Zoho Sign users! We are delighted to introduce the latest enhancements to Zoho PDF Editor, designed based on user feedback and feature requests. This update enables you to reorder, extract, and rotate PDF pages, add watermarks, and collect signatures.
                                  • Payment Gateways - A unified hub to manage all your payment integrations in Zoho Creator

                                    Hello everyone, We're thrilled to announce that we've completely reimagined the way payment gateways are handled in Creator. The result is a centralized Payment Gateways section that provides a clean, user-friendly interface to configure and manage all
                                  • Tip #13: Identify where your bookings come from with Source Tracking

                                    Source tracking is the practice of identifying where your bookings originated. This is important, because online bookings come from a wide variety of sources like social media platforms, your website, email and ad campaigns, partner websites, organic
                                  • How do you print a refund check to customer?

                                    Maybe this is a dumb question, but how does anyone print a refund check to a customer? We cant find anywhere to either just print a check and pick a customer, or where to do so from a credit note.
                                  • Cant't update custom field when custom field is external lookup in Zoho Books

                                    Hello I use that : po = zoho.books.updateRecord("purchaseorders",XXXX,purchaseorder_id,updateCustomFieldseMap,"el_books_connection"); c_f_Map2 = Map(); c_f_Map2.put("label","EL ORDER ID"); c_f_Map2.put("value",el_order_id); c_f_List.add(c_f_Map2); updateCustomFieldseMap
                                  • Zoho Books CREDIT LIMIT is completely USELESS due to a BUG!!! Please fix it ASAP!!

                                    Credit Limit should not be taken into account if payment terms on the Invoice are without credit. If selected Credit 0 days (Prepayment) why in this world would a notification pop up saying credit limit is exceeded and not allowing to create an invoice?
                                  • Printed Reports, Increase Font SIZE

                                    I need to send some printed copies of financial reports to my attorney. The reports print out with microscopic fonts. How do I increase the font size so that a normal human can read the text? Every other accounting app can do this so I imagine I have
                                  • Avoid email sending!

                                    Hello, Thanks you Zoho for the wonderful apps you provide. Question: Is there a way to disable sending emails when: - creating an estimate or billing. Thanks Tommy
                                  • Need to show discount before total after subtotal

                                    Need to show discount before total after subtotal on my estimate template (see attachment)
                                  • Email a "thank you" note for this payment is NOW checked by default

                                    Hello Team, Just noticed that Email a "thank you" note for this payment is now checked by default. I tried searching in Preferences and there is no way to turn this off. I do not want this to be the default. Is there a way to turn this off?
                                  • End-to-end services hours

                                    We are trying to determine the best method of quoting service hours on quotes but only present the sum amount to a customer, without losing the tracking of quantity of hours for invoicing purposes. Does anyone have a good method they have determined?
                                  • Specific Approval Question

                                    Hi everyone, Just a quick question here. I have located the "Approval Type" in the preferences, which is great, and I am sure we could make use of it. However, I am trying to understand how I can implement an approval "workflow". The business call it
                                  • Zoho Books - Show Discount Totals When Greater Than Zero

                                    Hi Books Team, I understand that to show or hide discount amount on a Quote or Invoice, I need to use different templates. It would be a great quality of life improvement for users if we had an option to show or hide the discount amount at line item and
                                  • Zoho Books - Sales Person Information

                                    Hi Team, On Invoices, Quotes, etc... I can include the Sales Person, but it only shows their name and not their email or phone number. It would be great to have place on invoice templates where we can manage what sales person information should be shows
                                  • Specifying a filename for Schedule Reports

                                    Is it possible to specify a filename to use with scheduled reports? For example: With a general ledger report, instead of general_ledger.pdf I would like to include the date the report was generated in the filename so it is called general_ledger_202
                                  • Need to upsert "Created Time" field in Leads Module

                                    I am in the process of implementing Zoho CRM for my business. I need to modify the "Created By' field to reflect the actual date/time the lead was captured in my original Excel file. Otherwise, my conversion velocity data will always be inaccurate, which
                                  • Refund Form Can’t Reverse “Bank Charges” Line — Throws Off Reconciliation

                                    Zoho, When we pay a vendor, the Payment screen lets us add a “Bank Charges” amount (we post a $1 processing fee there). Perfect. But on the Refund popup there’s no matching field, so the refund can only return the net expense. If our processor sends back
                                  • Playback and Management Enhancements for Zoho Quartz Recordings

                                    Hello Zoho Team, We hope you're all doing well. We would like to submit a feature request related to Zoho Quartz, the tool used to record and share browser sessions with Zoho Support. 🎯 Current Functionality As of now, Zoho Quartz allows users to record
                                  • HTML for confirmation email

                                    Hi, After a prospect submitted the Zoho form, we want to send a confirmation mail. In this mail we want to add our email signature. However, while this is possible in Zoho CRM this doesn't seem to be an option in Zoho Forms. Also an html editor is not
                                  • Fire a webhook when the user gets access to portal

                                    Hello, We would like to know if there is any way in which we can automate a webhook call if the user accepts the portal invitation that Zoho sends by email. The customer module does have the option to trigger webhooks when a customer is created, updated,
                                  • Clone a Module??

                                    I am giong to repurpose the Vendors module but would like to have a separate but very similar module for another group of contacts called Buyers. I have already repurposed Contacts to Sellers. Is it possible to clone (make a duplicate) module of Vendors
                                  • Zoho Writer Default Publish Setting for Mail Merge

                                    Hello, I was thinking of using Mail Merge to create documents from CRM and automatically link them. However, I noticed the "publish" function and it seems the default is "to the world". This creates some anxiety as it is not clear what this "to the world"
                                  • One Contact with Multiple Accounts with Portal enabled

                                    I have a contact that manages different accounts, so he needs to see the invoices of all the companies he manage in Portal but I found it not possible.. any idea? I tried to set different customers with the same email contact with the portal enabled and
                                  • Enable History Tracking for Picklist Values Not Available

                                    When I create a custom picklist field in Deals, the "Enable History Tracking for Picklist Values" option is not available in the Edit Properties area of the picklist. When I create a picklist in any other Module, that option is available. Is there a specific reason why this isn't available for fields in the Deals Module?
                                  • Rich Text For Notes in Zoho CRM

                                    Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
                                  • Creating Payrun summary by fetching values from the employee payruns and adding them

                                    I am trying to make a processing payrun module. I want on Form load to autofill payrun summary eg Total Deductions, Total employer contributions etc by fetching one value after the other in the employee payrun information. So it should loop through the
                                  • 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
                                  • Creator - Portal Custom Domain

                                    I will pay $100 in crypto to anyone who can actually get my Creator Custom Domain to function (actually tell me how you got yours to).  Domain verifies, Nothing. I've been fighting it a week, multiple chats to customer service. Clearly I'm doing something wrong.  Some datapoints Domain name itself unimportant, can be a string of numbers.  I need to know what registrars are working for you because GoDaddy does NOT.  Do I need hosting? I've tried both ways and nothing works.  I pushed through Cloudflare
                                  • Next Page