Kaizen#162 : Add Tags and Open Pre-filled Email Drafts via Client Scripts

Kaizen#162 : Add Tags and Open Pre-filled Email Drafts via Client Scripts



Hello everyone!

Welcome to another informative Kaizen post. In this post, let us see how to accomplish the following using Client Script.

1.  How to auto-tag a record based on field update?

2. How to Open a pre-filled email draft 

This post will provide a quicker solution using Client Script for the queries mentioned in the posts Is it possible to auto fill email draft? and How to tag quickly?

In this Kaizen post,



  1. Tags in Zoho CRM
  2. ZDK functions related to Tags
  3. Use Case 
  4. Solution
  5. Summary
  6. Related Links



1. Tags in Zoho CRM

Tags in Zoho CRM are not just a simple category; they can be more powerful since you can add multiple tags to a single record. You can also create tags in multiple locations in your CRM account, if required. Click here to know more about working with tags.
2. ZDK Functions related to Tags

Below are the ZDK Client APIs supported by Client Script related to tags. Click here to view the documentation.
  • addTag()  - Add a tag/tags to a record
  • removeTag() - Remove a tag/tags to a record
  • getTags() - Get the list of all tags of a record

Notes
Note :
 These ZDKs can be used only for Detail Page(Canvas) and Detail Page(Standard)

Apart from these, you can use the below ZDK CRM APIs to add and remove tags.
  • addTagsToRecord()         - Add Tags to Record
  • addTagsToRecords()       - Add Tags to Record
  • removeTagsToRecord()  -  Remove Tags from Record
  • removeTagsToRecords() - Remove Tags from Records

Notes
Note
The above ZDKs implicitly invoke the Add tags API and Remove tags API. Click here for more details.The execution of the above ZDKs will impact your API credits

To know more about Client Script's ZDKs to implicitly invoke CRM APIs, check this kaizen post. The event onTagChanged - This event occurs on the click of save button of Add tags.

3. Use Case 

Quote
At Zylker, the manager seeks to optimize the handling of order complaints by automating the tagging and notification process. When a customer support agent who places an order on behalf of customers also logs a complaint in the "Order Issue" field of the Orders module, then the order should automatically be tagged as "Issue Reported." This action should open an email draft, pre-filled with a specific template , along with the "To," "From," and "Subject" fields automatically populated after getting confirmation from the customer support agent, and notify the delivery team to check and resolve the issue.

4. Solution

For the above requirement, you need to create a Client Script that triggers when the customer support agent updates the Order issue field.
  • Configure a Client Script for Detail Page(Standard) Orders module, that triggers during onBeforeUpdate Event of Type Field event of Order Issue, as shown below and click Next



  • Click here to know how to configure a Client Script.
  • Enter the following script in the IDE and click Save.

  1. if (value != null) {
  2.    ZDK.Page.addTag('Issue Reported');
  3.    ZDK.Client.showConfirmation('The Tag *Issue Reported* has been added successfully.    Do you want to notify support team?', 'Yes', 'No');
  4.     ZDK.Client.openMailer({ from: 'support@zylker.com', to: [{ email: 'zylker@zyldomain.com', label: 'zylker@zyldomain.com' }], cc: [{ email: 'info@zyldomain.com', label: 'info@zyldomain.com' }], subject: 'Issue Reported', body: '', templateId: "4967860000006521006" });
  5. }
  • In the above script, whenever the customer support agent updates comments in this field, a new tag gets added by ZDK.Page.addTag(). Here is the syntax:


  • Once the tag gets added, a message gets displayed using the ZDK.client.showConfirmation(). The message mentioned in the confirmation box supports markdown. Based on confirmation, the mail draft opens using ZDK.Client.openMailer(). Here is the syntax:


  • Here, you need to specify the template ID of the email in the openMailer() ZDK along with the other details like from, to , cc. 
  • To get the template ID, go to setup-->templates-->select the template that you want and click edit.
  • You can pick the template ID from the URL.


  • Click here to know more about email templates. Here is how the Client Script works.


    Summary

    In this post, we have seen
  • How to add a tag automatically to a record when a Detail Page is updated.
  • How to fetch the tags associated with a record using Client Script.
  • How to open pre-filled email draft from Detail Page(Standard)
  • How to fetch the template id of an email

Related Links: 

Let us know your thoughts in the comment section or reach out to us at support@zohocrm.com. Stay tuned for more insights in our upcoming Kaizen posts!


Happy Client Scripting!


    Access your files securely from anywhere


            All-in-one knowledge management and training platform for your employees and customers.






                                  Zoho Developer Community




                                                        • Desk Community Learning Series


                                                        • Digest


                                                        • Functions


                                                        • Meetups


                                                        • Kbase


                                                        • Resources


                                                        • Glossary


                                                        • Desk Marketplace


                                                        • MVP Corner


                                                        • Word of the Day


                                                        • Ask the Experts



                                                                  • Sticky Posts

                                                                  • Kaizen #198: Using Client Script for Custom Validation in Blueprint

                                                                    Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
                                                                  • Kaizen #226: Using ZRC in Client Script

                                                                    Hello everyone! Welcome to another week of Kaizen. In today's post, lets see what is ZRC (Zoho Request Client) and how we can use ZRC methods in Client Script to get inputs from a Salesperson and update the Lead status with a single button click. In this
                                                                  • Kaizen #222 - Client Script Support for Notes Related List

                                                                    Hello everyone! Welcome to another week of Kaizen. The final Kaizen post of the year 2025 is here! With the new Client Script support for the Notes Related List, you can validate, enrich, and manage notes across modules. In this post, we’ll explore how
                                                                  • Kaizen #217 - Actions APIs : Tasks

                                                                    Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
                                                                  • Kaizen #216 - Actions APIs : Email Notifications

                                                                    Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are


                                                                  Manage your brands on social media



                                                                        Zoho TeamInbox Resources



                                                                            Zoho CRM Plus Resources

                                                                              Zoho Books Resources


                                                                                Zoho Subscriptions Resources

                                                                                  Zoho Projects Resources


                                                                                    Zoho Sprints Resources


                                                                                      Qntrl Resources


                                                                                        Zoho Creator Resources



                                                                                            Zoho CRM Resources

                                                                                            • CRM Community Learning Series

                                                                                              CRM Community Learning Series


                                                                                            • Kaizen

                                                                                              Kaizen

                                                                                            • Functions

                                                                                              Functions

                                                                                            • Meetups

                                                                                              Meetups

                                                                                            • Kbase

                                                                                              Kbase

                                                                                            • Resources

                                                                                              Resources

                                                                                            • Digest

                                                                                              Digest

                                                                                            • CRM Marketplace

                                                                                              CRM Marketplace

                                                                                            • MVP Corner

                                                                                              MVP Corner









                                                                                                Design. Discuss. Deliver.

                                                                                                Create visually engaging stories with Zoho Show.

                                                                                                Get Started Now


                                                                                                  Zoho Show Resources

                                                                                                    Zoho Writer

                                                                                                    Get Started. Write Away!

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

                                                                                                      Zoho CRM コンテンツ




                                                                                                        Nederlandse Hulpbronnen


                                                                                                            ご検討中の方





                                                                                                                      • Recent Topics

                                                                                                                      • Introducing the Zoho Projects Learning Space

                                                                                                                        Every product has its learning curve, and sometimes having a guided path makes the learning experience smoother. With that goal, we introduce a dedicated learning space for Zoho Projects, a platform where you can explore lessons, learn at your own pace,
                                                                                                                      • Leave request problem on mobile phones

                                                                                                                        Hello, When any employee attempts to submit a leave request on an Android or iOS phone, the error shown in the attachment appears. How can we solve this problem?
                                                                                                                      • [Webinar] Digitizing forms and form-based workflows

                                                                                                                        Live webinar on August 13, 2026 | Time: 2 PM IST | 2 PM EDT Hi, Struggling with paper forms, manual data entry, disconnected approvals, and form data that never reaches the apps that need it? Join our live webinar to learn how Zoho Writer's fillable templates
                                                                                                                      • Multi-currency and Products

                                                                                                                        One of the main reasons I have gone down the Zoho route is because I need multi-currency support. However, I find that products can only be priced in the home currency, We sell to the US and UK. However, we maintain different price lists for each. There
                                                                                                                      • Price Book in foreign currency

                                                                                                                        We have many customers who buy in foreign currency (USD), where our base currency is our local currency (AUD). It would be normal (it is in Zoho Books, Zoho Inventory etc.) to assign a currency to a price book, but I cannot find this option in Zoho CRM
                                                                                                                      • Assign Price Book to Accounts (again!)

                                                                                                                        I can see this topic has been bumping about for over 10 years and unfortunately Zoho hasn't seen the need (or use case) in CRM to be able to assign an account to a price book to automate quoting (amongst other things). Strange given they DO assign price
                                                                                                                      • Remove "Subject" as a required field on quotations

                                                                                                                        Not sure why, but Zoho has made 'Subject' a system defined required field. I'm not entirely sure why subject would be required as a key field (i.e. you cannot deactivate it or change it from required). It doesn't make much sense on many product quotations,
                                                                                                                      • Approve records efficiently: Useful enhancements to My Jobs module and Approval process in Zoho CRM

                                                                                                                        Dear Customers, As you might know, approval process is a process automation tool that allows you to automate approvals in your organization and My Jobs is where you approve requests from a single point of view. Here's how you'd go about it: You’d add
                                                                                                                      • Text/SMS With Zoho Desk

                                                                                                                        Hi Guys- Considering using SMS to get faster responses from customers that we are helping.  Have a bunch of questions; 1) Which provider is better ClickaTell or Screen Magic.  Screen Magic seems easier to setup, but appears to be 2x as expensive for United States.  I cannot find the sender id for Clickatell to even complete the configuration. 2) Can customer's reply to text messages?  If so are responses linked back to the zoho ticket?  If not, how are you handling this, a simple "DO NOT REPLY" as
                                                                                                                      • Need complete Zoho Commerce theme ZIP example and safe staging workflow

                                                                                                                        I want to build a complete custom Zoho Commerce storefront through Edit Code, including: • Global header and footer • Responsive homepage • Category, search and filter pages • Product cards and product-detail pages • Cart and checkout wrapper • Mobile
                                                                                                                      • Add Support to Upload Inventory Items with Categories or Enable Separate Upload for Inventory Categories

                                                                                                                        Currently, Zoho Inventory does not support uploading new items along with their parent and sub inventory categories using the item import feature. This creates challenges for businesses with structured inventory hierarchies when trying to upload items
                                                                                                                      • i need active of my whatsapp business number in zoho

                                                                                                                        i am waiting from 3 days for active of my whatsapp business account in crm ,its too late to configure.its just showing account details i can't able to know its connected or not anything else
                                                                                                                      • Sub-Form Padding in CSV Export

                                                                                                                        Hi, When you use the Sub-Form, and for example you have a Date Field on the Main Page, then Option 1 and Option 2 fields on the Subform, when you export this to CSV the Date column will only have the Date in 1 row, the first row, it would be nice to pad
                                                                                                                      • Integrate your Outlook/ Office 365 inbox with Zoho CRM via Graph API

                                                                                                                        Hello folks, In addition to the existing IMAP and POP options, you can now integrate your Outlook/Office 365 inbox with Zoho CRM via Graph API. Why did we add this option? Microsoft Graph API offers a single endpoint to access data from across Microsoft’s
                                                                                                                      • Analytics Dashboard User Filters Default Value

                                                                                                                        User Filters on Dashboard do not allow Unknown to be set as a default filter value. I have to include NULL values in my dashboard among other values but I can't include NULL/Unknown by default in Dashboard User Filters.
                                                                                                                      • Microsoft is retiring Exchange Web Services (EWS): Here's what it means for Zoho Mail users

                                                                                                                        Microsoft has officially announced the retirement of Exchange Web Services (EWS) for Exchange Online. If your organization is planning to migrate from Microsoft 365 to Zoho Mail, you may be wondering what this change means for you. The good news is that
                                                                                                                      • Zoho Writer page break in a merge repeating region always adds an unwanted blank page

                                                                                                                        Hi I'm merging a Zoho CRM record to a Zoho Writer document with a repeating region to display subform records on their own page within the document. When I try to insert a page break in a repeating region, the resulting merge always adds an unwanted blank
                                                                                                                      • ZeptoMail account pending review, SMTP blocked with relaying-issues

                                                                                                                        Hi ZeptoMail team/community, Our ZeptoMail account has been pending review for more than 3 business days and still shows: “Your account is yet to be reviewed.” I already created a support ticket, but have not received an update yet. Ticket details: Request
                                                                                                                      • Zoho ERP | Product updates | June 2026

                                                                                                                        Hello users, We launched Zoho ERP on January 23, and since then, our goal has been to help businesses streamline and manage their operations with greater efficiency, flexibility, and control. Since the launch, we've continued to enhance the platform every
                                                                                                                      • Tip #83- Give Customers a Faster Way to Reach You with the Quick Support Plugin – 'Insider Insights'

                                                                                                                        Hello Zoho Assist Community! Think about the last time a customer needed urgent support. They emailed in, waited for a response, got a session link, couldn't find it in their inbox, called back, and by the time the session actually started, a good chunk
                                                                                                                      • How to Open .mbox file in Gmail with Attachments?

                                                                                                                        Gmail offer users to backup INBOX folder in .mbox file format via Google Takeout Feature. Howver there is no such option to Restore Gmail MBOX. Thus I would like to suggest you to choose an alternate approach i.e. MBOX to Gmail Wizard. This utility will open .mbox file in Gmail with attachments.  Steps to open MBOX file in Gmail are; Run MBOX to Gmail Wizard Click Add File and add .mbox file. Enter your Gmail login credentials. Click Convert button. Finished! This is how you can open MBOX file in
                                                                                                                      • Seperate rating scales for KRA's and Competencies in appraisals

                                                                                                                        Is there a way to set-up different rating scales for KRA's and Competencies?? I would like to have; Met/Not met for KRA's and a 1-5 scale for the competencies I know how to set up custom ratings but it spans across both sections and I need them to be
                                                                                                                      • Is there a CRM Deluge function available to convert an RTF (rich text field) to plain text (with no formatting tags)?

                                                                                                                        I know that we can run reports so that RTF fields can either show as plain text or the text or the text with the formatting fields included (which is wonderful, btw, as it helps me adjust tags when I need to troubleshoot and just see what I need to see
                                                                                                                      • How do I set the value of a Lookup field in SlyteUI?

                                                                                                                        I am using the "crm-field" component in a SlyteUI project (code attached) https://www.zohocrm.dev/explore/slyteui/ui-components/crm-field/api#Properties The client would like to have this field pre-populated with a value. When I try to input the record
                                                                                                                      • Mise à jour de Zoho Books – France

                                                                                                                        Chers clients, Merci pour votre patience et votre soutien continu. Avec les évolutions réglementaires à venir en France nous introduisons de nouvelles fonctionnalités dans Zoho Books pour les clients français. Ces mises à jour ont été conçues pour répondre
                                                                                                                      • CRM Developer Update: Mandatory field behavior changes in Zoho CRM APIs

                                                                                                                        We are planning a few updates to Zoho CRM APIs that are expected to be rolled out by the end of October 2026. These changes are not live yet. We are sharing this early so developers and partners can review the impact and prepare in advance. What is changing?
                                                                                                                      • Show Available Stock as a Column in Item Views (Including by Warehouse)

                                                                                                                        It would be very useful to have Available Stock as a standard column in the Items list view. Currently Stock On Hand does not show the real picture for businesses managing orders and inventory. Example: Stock on Hand: 100 Committed to Sales Orders: 80
                                                                                                                      • What's New in Zoho POS - July 2026

                                                                                                                        Hello everyone, Welcome to Zoho POS’s monthly update, where we share our latest feature updates, enhancements, events, and more. Let’s take a look at how July went. Support for Saudi's ZATCA Phase 2 e-invoicing We have added support for ZATCA (Zakat,
                                                                                                                      • How to make Contact a Help Center User

                                                                                                                        I see a "IsPortalUser" checkbox on each of the Customer account, but I am unable to check the checkbox. How is this configured?
                                                                                                                      • Introducing the new Fields API

                                                                                                                        Hello everyone, Greetings from Zoho Desk's API corner! With the rising need for integrations to connect multiple tools in businesses, APIs need to be adaptive, reliable, consistent, and ready for dynamic operations. To support better performance, efficiency,
                                                                                                                      • Service locations are tied to contacts?

                                                                                                                        Trying the system out. And what I discovered is that it seems that the whole logic of the app is, I'd say, backwards. There is a Customer - a company. The company has contact persons and service locations can be associated with different contact persons.
                                                                                                                      • Zoho ResearchStudio Shutdown Notice

                                                                                                                        Hi ResearchStudio fam, We are writing to inform you that Zoho ResearchStudio will be discontinued from Oct 5, 2026. Thank you for being a part of our journey and for trusting us with your qualitative research work. What this means for your data: Your
                                                                                                                      • SlideShare Downloader PDF not syncing in Zoho WorkDrive

                                                                                                                        Hi everyone, I use SlideShare Downloader for save study PPT and PDF files. After download I upload files in Zoho WorkDrive, but sometimes PDF preview not showing or sync take very long time. Small files work okay but some bigger presentation files have
                                                                                                                      • メモの保存場所、見直しませんか?― Zoho Notebookで始める情報管理

                                                                                                                        ユーザーの皆様、こんにちは。ゾーホージャパンの朝香です。 AIを利用した業務が広がる中、AIによる情報漏洩対策を進めている組織も多いのではないでしょうか。 一方で、日常的に使っているメモの管理については、対策できていますか? 業務中のメモには、重要な情報が含まれていることがあります。 そのため、AIへの入力だけでなく、メモの保存先についても是非確認をおすすめしたいと思います。 そこで今回は、使いやすさだけでなく、セキュリティにも配慮して設計されたZohoのノートアプリ「Zoho Notebook」をご紹介します!
                                                                                                                      • Zoho Sheet offline is now live on iPhone

                                                                                                                        Hello everyone, We've just rolled out offline support for Zoho Sheet on iOS—you can now create, edit, and analyze spreadsheets on your iPhone without an internet connection. Offline support has been a sustained priority for us. We're on the verge of bringing
                                                                                                                      • You can now sync records from Custom Modules in Zoho CRM

                                                                                                                        p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0.0cm; font-size: 12.0pt; font-family: Cambria; } p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph { margin-top: 0.0cm; margin-right: 0.0cm; margin-bottom: 0.0cm; margin-left: 36.0pt; font-size: 12.0pt; font-family: Cambria; } p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst { margin-top: 0.0cm; margin-right: 0.0cm; margin-bottom: 0.0cm; margin-left: 36.0pt; font-size: 12.0pt; font-family: Cambria;
                                                                                                                      • Zoho ERP | Product updates | July 2026

                                                                                                                        Hello users, We're back with another round of updates to help you streamline your operations. This month's release brings new features and enhancements designed to help you work more efficiently. Read on to discover everything that's new in Zoho ERP this
                                                                                                                      • Fixed cost per task

                                                                                                                        Is there any way to assign a fixed cost per task, but track time for internal reporting? Don't see a way to do this currently.
                                                                                                                      • Please critique my CRM design

                                                                                                                        I run a disability healthcare business with 2 business units. We run on Zoho One and are re-designing our CRM. We have developed the design concept ourselves, and I am hoping to get some critical feedback: 1) Noting that this is an early design of the
                                                                                                                      • Set custom date creation for ticket using API in Desk

                                                                                                                        Hi. all.. I want know if is possible to add ticket with custom creation date via API... This would to be great because we are moving from another platform to Zoho and we have need to keep all statistics for old tickets also. In api docs i didnt see nothing about custom date in ticket creation but i would prefer a confirm from comunity/support. Thank you P.S.: Sorry for bad english language
                                                                                                                      • Next Page