HOW TO: Searching a thread (email body/text) with a custom function, allowing filtering and specific actions

HOW TO: Searching a thread (email body/text) with a custom function, allowing filtering and specific actions

We are still trialing out Zoho at this time, but have found a major expected feature to be missing - the ability to search within the text of an email for automation/workflows.

NOTE: You need to create a connection for zohodesk under settings -> Developer Space -> Connections. We named our connection zohodesk with link name 'zohodesk' and under choose scopes select all options.

I am sharing my current solution that may benefit other users needing similar functionality.
  1. For my example I created a Workflow for the Tickets Module.
  2. You can have this execute by any method, I have this execute on create (customer emails).
  3. For Criteria you may add what is necessary, but I have the criteria filtering (by searching email text) within the custom function and have section 3 "Criteria" empty.
  4. For Actions hit '+' and choose 'Custom Functions' (new or existing if you already made this)
Name your custom function something internally identifiable.

The Custom Function:
OrgID = ####;
getthreads = zoho.desk.getRelatedRecords(OrgID,"threads","tickets",ticketId,0,1);
threadid = getthreads.getJSON("data").getJSON("id");
getthreadcontent = zoho.desk.getRelatedRecordById(OrgID,"threads",threadid,"tickets",ticketId).getJSON("content");
if(getthreadcontent.containsIgnoreCase("cancel"))
{
updateticket = zoho.desk.update(OrgID,"tickets",ticketId,{"status":"Cancel"});
info updateticket;
}

Custom Function Notes:
  1. Update OrgID to your organization ID in zohodesk
  2. Replace 'cancel' under if(getthreadcontent.containsIgnoreCase("cancel")) to any keyword/phrase you want to search
  3. Change .containsIgnoreCase to .contains for case sensitive searches
  4. Under updateticket we are updating 'ticket' and the field is 'status' changing it to our custom text of Cancel. Here you can use different modules or fields to update - see full details here: https://www.zoho.com/deluge/help/desk/update-record.html
You can see all values you can update for the 'ticket' module here: https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Updateaticket under 'Attributes'

  1. This solution copies the thread (email body) to the description field
  2. The description field does have a limitation on length from my research
  3. Doing this duplicated every thread and showed two conversations
  4. The solution I posted above does not duplicate threads/conversations and allows searchability within the function instead of copying to description and then searching description
  5. Copying description and having another workflow 'search' description does not work as the workflows execute at the same time and the clone to description doesn't complete until after workflows execute.

    Zoho Campaigns Resources

      Zoho Desk Resources

      • Desk Community Learning Series


      • Digest


      • Functions


      • Meetups


      • Kbase


      • Resources


      • Glossary


      • Desk Marketplace


      • MVP Corner


      • Word of the Day


        • Sticky Posts

        • Webinar 2: Supercharged customer support for growing business

          Join us for this webinar and learn how to step up your support game using a real-time communication platform to generate happier, more successful customers. In this live webinar, we will will discuss the importance of SalesIQ for your support team and how it can help you:  Understand your customers better and their journeys to proactively support and engage them even before they ask for help.  Integrating real time conversations into Zoho Desk’s Support, providing a conversational customer service
        • Customize Colors of your Customer Self Service Portal

          You asked for it. We heard you. We're happy to roll out the most sought after feature request, Customizing the Colors of your Customer Self-service Portal. Now you can set the color of your customer portal to mimic your company's web site, so that your customers visiting the portal will not feel alienated by the default theme.  Go ahead and configure the color of the header, tabs, fonts and background according to your needs. You can either choose between default color themes like Blue, Grey, Green
        • Edit and Delete options in Comments

          A lot of teams have been using ticket comments extensively to collaborate everyday. Notification Center further improved this experience by bringing real-time updates. As we continue to build more improvements to this experience, we've shipped a small-yet-important
        • 2024 Email Authentication Standards: Elevating Security with Google and Yahoo

          In contemporary email communication, email authentication plays a pivotal role in mitigating email fraud, spam, and phishing attacks. Brace yourself for a new level of security. Starting February 2024, Gmail and Yahoo will be implementing robust email
        • Announcing the New and Improved Article Editor

          KBase articles are known to help customers, find solutions to problems on their own and set the stage for ticket deflection. That said, the way you present your KBase content is the clinching factor that ensures your customers stick around to consume it.  We took it upon ourselves to build an editor that allows you to publish articles without delving into the code. Well, at least for the most part. With more options and a redefined interface, the article editor in Zoho Desk is now better than ever!

        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

                                • Search Bar Improvement for Zoho Commerce

                                  Hey everyone, I've been using Zoho Commerce for a bit now, and I think the search bar could really use an upgrade. Right now, it doesn't show products in a dropdown as you type, which would make finding items a lot faster. On Shopify, for example, you
                                • Send Whatsapp with API including custom placeholders

                                  Is is possible to initiate a session on whatsapp IM channel with a template that includes params (placeholders) that are passed on the API call? This is very usefull to send a Utility message for a transactional notification including an order number
                                • Can't get form response to populate custom PDF template

                                  I've created a template and set it to default but can't figure out how to get the response to populate that template. It keeps giving me the default summary.
                                • Zoho Sheets not compatible with Excel/Google Sheets

                                  In order to share a copy of a Zoho sheet with someone that does not use Zoho, it must be downloaded as MS Excel format and then added to an email.  This is a labor intensive, and frankly confusing process.  I have forgotten to do this before, only to
                                • Zoho One not working

                                  I'm having several issues accessing Zoho One. Some pages don't load (for example, Zoho Directory) and the labels are all messed-up (oz.account.directory.display.shorname, oz.settings...., etc.)
                                • Add Ability to Designate Decision Branches as "Error Branches"

                                  Zoho Flow gives the ability to track down, troubleshoot, and fix errors with the Status and Filter dropdowns in the History tab. This works well for when a "normal" Flow action registers with an error. However, there are other times where it would be
                                • 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
                                • Visitors sending message via Whatsapp are not saving on contacts

                                  Visitors who sends me messages from Whatsapp when i finish the chat do not populate on contacts, how can I add them as contacts?
                                • ChatGPT only summarize in English

                                  Hello i' v enabled chatgpt in salesIQ, it works great inside conversation (revise, Rephrase etc) add tags works well with another language than English. But when I want to summarize it render only in English, despite sales IQ is set to another language.
                                • Brand with multiple facebooks pages

                                  HI, We are a small publisher that has different FaceBook pages for each of our product lines. All are within the same FB account.   Is it possible to add all of these pages to our one brand in zoho social so I orchestrate the posts between the different products?    Cheers, Joe
                                • Connect multiple Facebook ad accounts to Zoho Social

                                  Hi there. I'm doing the Facebook Ads and Zoho Social integration to automate the leads that come from Potential Customer campaigns on Facebook to Zoho CRM. I have a company (1 fanpage, 1 brand), but within the business or brand on Facebook, I manage several
                                • How do I connect Sales IQ to Shopify

                                  How do I connect Sales IQ to Shopify.    
                                • DORA compliance

                                  For DORA (Digital Operational Resilience Act) compliance, I’ll want to check if Zoho provides specific features or policies aligned with DORA requirements, particularly for managing ICT risk, incident reporting, and ensuring operational resilience in
                                • 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
                                • Stock Count - Does it really work?

                                  We have been trying to use the new Zoho Inventory stock count feature. It seems great at first glance.. ..but what we can't get our heads around is if a count doesn't match you can't simply set up a recount of those that are unmatched, which just seems
                                • Create Ticket from Chat with Rest API

                                  Hi to everyone, is possible to create a ticket from Chat with Rest API? In user interface is possible by clicking on the button "Convert chat as a ticket". Anyone know how to do that? Thanks
                                • How to send binary data in invokeurl task?

                                  Hello, I am using Adobe's Protect PDF API. Source: https://developer.adobe.com/document-services/docs/overview/pdf-services-api/ Everything works fine in Postman. But for some reason after encrypting the file, it is empty after password protecting the
                                • 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
                                • JOB Sheet can not send PDF as service rapports and more info needed other topic

                                  Goedendag, - Jullie hebben nu job sheet erin gedaan en dar is echt super goed, enkel kunnen we de werkbon ( JOB sheet) nu niet verzenden als PDF als een service rapport naar onze hoofdaannemer hoe we dat nu doen als bewijs van de levering van het werk
                                • How Can I Customize Sales Reports in Zoho CRM to Better Track Our Sales Team's Performance?

                                  Hello everyone, I'm new to using Zoho CRM and need some help with customizing our sales reports. We want to track our sales team's performance more effectively and visualize trends that can inform our strategy. What specific customizations or features
                                • Marketing Automation : Adding to existing Lead Score

                                  I want to be able to add a score to an existing ZMA lead however I can't find the field in the "Fetch Lead" action that contains the existing score. There is an action for Add lead score, but that's not clear if it overwrites the existing value or adds
                                • Items should display under specific warehouse

                                  I have configured the multi warehouse but it show all the items under all warehouse which is not correct according to our business logic, so i want that items should only display under that specific warehouse not under all the warehouses not even with zero quantity. Some items should be common but not all so is there any option for that purpose so i can specific the items to its warehouse. Regards
                                • Package Dimensions

                                  Packages need to have dimensions that are sent to carriers in addition to just the weight. Without the package dimensions being transmitted to carriers, the correct dimensional weight is not calculated for the label price, which results in corrections
                                • Theft Prevention Sensor Integration in Zoho Inventory

                                  Is there a way to integrate a theft prevention sensor with Zoho Inventory, so items cannot leave the store unless they've been scanned at checkout? Any insights or existing solutions would be greatly appreciated.
                                • Zoho Workplace gets yet another security boost: The addition of Zoho Vault

                                  Hello Community, Passwords are often the first line of defense, yet they're also one of the most common weak points. We're thrilled to announce that Zoho Vault is now integrated with Zoho Workplace! Zoho Vault Standard is now included at no extra cost
                                • Where is the customization and extendibility of zoho inventory?

                                  After delving into zoho one subscription to test out systems we need for our business, I'm really disappointed after working in Zoho Inventory. Its features and customizability are extremely lacking compared to the other tools like CRM. In our case we
                                • "notes"-field in a task to full width?

                                  Hi, Is there someone that can tell me how to adjust the "notes"-field in a task, to full width? I already played around with 1 or 2 columns, but this has nu effect on the standard width. Thx in advance for your help. Cheers, Ralph.
                                • How to download Job Sheets in Zoho FSM?

                                  Hello, I'd like to download copies of completed job sheets as PDF's for upload to a workdrive to keep an audit record of completed Job checkout sheets. I do not see download of this file type as an option - any help is appreciated!
                                • 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
                                • [Webinar] Zoho Writer for law firms and legal professionals

                                  Are manual processes slowing down your legal practice? Are you ready to simplify document management and free up more time for your team to focus on what truly matters? Join us on January 16, 2025, for an exclusive Zoho Writer webinar designed specifically
                                • Introducing Bin Locations In Zoho Inventory

                                  Hello users, We are excited to let you know that your wait for the Bin Locations feature has now come to an end! Yes, you heard us right! We are here to introduce the much-awaited Bin Locations now in Zoho Inventory. But before we dive into the feature
                                • How to send mail with js SDK

                                  Hell o I'm using https://live.zwidgets.com/js-sdk/1.2/ZohoEmbededAppSDK.min.js, for my widget in CRM (built with sigma) Is it possible to send email from js file, I try ti use that ZOHO.CRM.API.sendMail({ "Entity": "Accounts", "RecordID": sharedVariableEntityId,
                                • Cannot add Zoho Forms link to LinkedIn

                                  Hello, We have encountered a problem where we are unable to share a Zoho Forms link on LinkedIn. This is what we got from LinkedIN, but we have not heard back from Zoho Support as yet, and we are meanwhile stuck... "It seems the URL does not scrape the
                                • Feature request - pin or flag note

                                  Hi, It would be great if you could either pin or flag one or more notes so that they remain visible when there are a bunch of notes and some get hidden in the list. Sometimes you are looking for a particular name that gets lost in a bunch of less important
                                • i keep see there is a connetion issue connecting 3rd party api on zoho when using zia

                                  hi there , i have set up open ai api to zoho zia (copied and pasted to zoho zia) but I keep getting notificaiton "there is a connetion issue connecting 3rd party api on zoho" when using zia on top when click zia and try to type in word there
                                • SendMail in CRM Deluge function rejects a validated email address

                                  In a CRM Deluge function, the email address is considered invalid. Is there another method by which it can be validated? It's unacceptable in my current situation to use either the zoho.loginuserid or adminuserid as the From address.
                                • how do i remove a specific Zoho Service from my account

                                  I no longer need Zoho CRM, ZRM Assist nor ZRM BugTracker. How do I remove them from the list of apps for my account?
                                • Link project tasks to tasks in CRM and/or other modules.

                                  Hello, I have created and configured a project in Zoho Projects with a set of tasks. I would now like to link these tasks (I imagine according to the ID of each one) to actions in the CRM: meetings, tasks, analytics). The aim is to link project tasks
                                • Introducing 'Queries' In Zoho CRM

                                  Hello everyone! We are here with an exciting feature - Queries in Zoho CRM! A little context before we dive right into the feature specifics :) In today’s fast-paced business environment, immediate access to relevant data is essential for informed decision-making.
                                • Build custom AI solutions with Catalyst’s QuickML capabilities in CRM

                                  Hello everyone, We’re thrilled to announce an improvement for our Zoho CRM Enterprise users: the ability to create custom AI solutions using Catalyst’s QuickML directly from Zoho CRM. As you may already know, Zia, Zoho CRM’s AI-powered assistant, offers
                                • Next Page