Automation#33: Automate Splitting Names for Existing Contact Records

Automation#33: Automate Splitting Names for Existing Contact Records



An organized directory – who doesn't love one?
Previously, we explored how to split contact names into First Name and Last Name for new contacts in Zoho Desk. But what about existing contacts already in your database? This week, we bring you a custom function that automates this process, ensuring a well-structured and easily searchable contact list.

Handling Existing Contacts
  • On ticket creation for an existing contact, this custom function will scan the email and split the name stored in the "Last Name" field into "First Name" and "Last Name."
  • To avoid unnecessary modifications, we introduce a checkbox in the contact layout. This allows you to mark contacts that have already been split, preventing duplicate actions.
Let's walk through the steps needed to ensure a smooth and error-free execution. 

I. Create a Checkbox Field in the Contacts Layout

a. Go to Setup >> Customization >> Layouts and Fields >> Select the Contacts module >> Select the layout >> Drag the checkbox field >> Give a desired name for the checkbox (e.g., Name Split).
b. Click on the gear icon of the checkbox field, select Edit Properties, and note the API name. This API name must be pasted into the custom function on line 4.
c. Uncheck the Enable by Default checkbox if it is marked.

II. Configure Custom Function within the Workflow Rule

Prerequisites
1. Create a connection
  1.1 Go to Setup(S) and choose Connections under Developer Space.
  1.2 Click Create Connection.
  1.3 Select Zoho OAuth under Default Connection.
  1.4 Set the connection name as deskcontact.
  1.5 Under Scope, choose the below scope values:
Desk.contacts.UPDATE
Desk.contacts.READ
  1.6 Click Create and Connect.
  1.7 Click Connect and click Accept.
Connection is created successfully.

2. Create a Workflow Rule
 2.1. Go to Setup, choose Workflows under Automation. 
 2.2 Under Workflows, click Rules >> Create Rule.

In the Basic Information section,
2.3. Select Tickets from the drop-down menu under Module.
2.4. Enter a Rule Name and Description for the rule.
2.5. If you want to activate the rule right away, select the Active checkbox. Else, create the rule and activate it later.
2.6. Click Next.
 
In the Execute on section, follow these steps:
2.7. Select Create.   
2.8. Click Next.
 
2.9. In the Criteria section, add criteria if required. click Next. 
2.10. In the Actions section, click the + icon and select New next to Custom Functions.
2.11. Enter a Name and Description for the custom function. Choose Tickets under Module.
2.12 Under Argument Mapping, give a desired Method Name. Map the arguments as below:       
         2.12.1 In the Argument Name field, type contactId and select Contact ID under the Contacts Section.                                     
2.13. In the script window, insert the Custom Function given below:
  1. //------------- User Input ----------
  2. orgId = "60xxxxxxxx0"; //replace with your Org ID
  3. operator = "."; 
  4. checkBoxFieldAPIName = "enter_the_field_api_name"; //Enter API name of the checkbox
  5. //---------------------------------
  6. logs = Map();
  7. try {
  8. contacts = zoho.desk.getRecordById(orgId,"contacts",contactId, "deskcontact");
  9. firstName = contacts.get("firstName");
  10. lastName = contacts.get("lastName");
  11. if(lastName.contains(operator))
  12. {
  13.        if(operator.contains(".")){
  14.          lastName = lastName.subString(0,lastName.indexOf("@"));
  15.        }
  16.        firstName = lastName.subString(0,lastName.indexOf(operator)).trim();
  17.        lastName = lastName.subString(lastName.indexOf(operator) + 1);
  18.        updateContact = zoho.desk.update(orgId,"contacts",contactId,{"firstName":firstName,"lastName":lastName,"cf":{checkBoxFieldAPIName:true}},"deskcontact");
  19.    }
  20. }
  21. catch (errorInfo)
  22. {
  23. logs.insert("errorInfo":errorInfo);
  24. }
  25. info "logs: \n" + logs;

  26. if(logs.containKey("errorInfo"))
  27. {
  28. throws "Error happen in the CF execution";
  29. }
NOTE
a. In Line 2, Enter your OrgId with  "  ". To access OrgId, go to Setup (S) >> Developer Space >> APIs >> API Authentication.
b. In Line 4, enter the API name of the check box created within the Contacts layout.  
Information
This custom function will split the contact name as First Name and Last Name based on the "." operator between the names in the email. 
2.14. Click Save to save the custom function.
2.15. Click Save again to save the workflow.
By implementing this custom function and workflow rule, you can automate the process of splitting contact names within Zoho Desk, ensuring a clean and organized database, which will enhance searchability. 
We hope this guide helps streamline your contact management! If you have any questions or need further assistance, feel free to share in the comments. Happy Organizing!
Best regards, 
Lydia |Zoho Desk

    • 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
    • Recent Topics

    • WhatsApp to shift to per-message billing from July 1, 2025

      Greetings Recruiters, If you’re using WhatsApp to connect with candidates through Zoho Recruit, there’s an important pricing change coming up that you’ll want to plan for. What’s changing? Starting July 1, 2025, WhatsApp is moving away from conversation-based
    • Implement full RTL support in Zoho Cliq, including text alignment and character positioning, regardless of the interface language.

      Dear Zoho Cliq Support Team, We are writing to request a significant enhancement to the current RTL language support within Zoho Cliq. Currently, while Zoho Cliq allows users to input text in RTL languages, the text alignment remains LTR, resulting in
    • Email Alerts with Affected Flow Details When Deprecating Modules in Zoho Flow

      Dear Zoho Flow Team, We would like to request an enhancement to the module deprecation process in Zoho Flow. 🧩 Current Limitation: Currently, when a module is deprecated by the Flow team: No email notifications are sent. There is no automated way to
    • are there Url parameters to group records in the report/view?

      There are URL parameters to filter records in target report.  Is there any way to group records in report by certain field, using URL parameters or embed report parameters? Or any other workaround, apart from creating second report for dofferent grouping?  Aim: I want to provide user a quick link to re-group embed report by different fields.
    • Setvalue() client script not working

      I have created a client script on the load the record(detail view page). I wanted to populate some default information in the single line field. for that I created the client script. below is the script: var field_obj = ZDK.Page.getField( 'Designation'
    • Power of Automation :: Automate Deal Status Update in Zoho CRM upon Project Completion.

      Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
    • Leverage the power of Zia (AI) to create Marketing Projects in Zoho Marketing Plus

      Hey everyone, Zoho's advanced AI assistant, Zia, now works with OpenAI to offer personalized marketing activity suggestions for your marketing projects in Brand Studio. With information such as your campaign's objective, duration, marketing channel types,
    • Use Zoho Flow to Supercharge your Zoho FSM Integrations

      We are thrilled to announce that Zoho FSM is now included in Zoho Flow - Zoho’s powerful no-code integration platform. With this, you can connect Zoho FSM with your most-used applications—without requiring technical expertise. What does this offer? Zoho
    • Zoho Flow triggers not working

      Hi , I have set up a flow which triggers when a new record is created in a Zoho Creator app. This flow works great when I initiate the flow with  "test and debug". However the flow does not trigger in live mode.  I have tested all the connections used
    • Can you sync your Apple Calendar with Bigin Activities/calendar?

      I've searched everything I can find and nothing is coming up... I've got a number of things in my calendar for the future, and it would be easiest if I can sync between them to update my availability for my booking page (also syncing the other way would
    • How to track salesiq on google analytics without GTM

      Hello! We had to move the installation of the SalesIQ widget from GTM to directly do it in our wordpress site. The SalesIQ widget was being blocked by Adblockers which caused a lot of our visitors to not be able to see it. This issue was fixed from deleting
    • Custom Module Count

      We are on Zoho One. CRM says that the three modules which support Zoho Sign integration are "custom modules." Do these count against the 200 custom modules permitted by the One access to "enterprise-level" CRM features?
    • Marketer's Space: Bookmarks by Zoho Campaigns

      Hello Marketers, In this week's Marketer's Space, we'll look at a simple yet powerful feature that makes a big difference in your workflow: Bookmarks. Bookmarks is a built-in feature in Zoho Campaigns that enables you to create a personalized library
    • I need a custom AI Chatbot to be integrated with ChatGPT to Handle Customers inquiries

      I need a custom AI Chatbot to be integrated with ChatGPT to handle Customer inquiries, and save the data to Zoho CRM as a Leads, Also to schedule a demo with clients and more options
    • User Management > Agents request

      I have a few suggestions for the Agent page: 1) Please add a way to filter Full agents. The list currently shows Light agents as an option but sometimes it would be helpful to view only the full agent licenses or non-light agent. 2) Add the ability to
    • Mandate Assessments in Zoho Recruit's Candidate Application Form

      We're excited to announce the Include Assessment option for the Candidate Application Form, which lets you display the pre-screening assessment associated with the job opening along with the application form fields. This ensures that every candidate applying
    • Sending an email from contacts does not display the recipient's name correctly

      When I select a contact or group of contacts and then click the envelope to send mail, the contacts are added to the To section of a new email. Unfortunately, their First and last names are not displayed. The part of the email address before the @ sign
    • Writing SQL Queries - After Comma Auto Suggesting Column

      When writing SQL Queries, does anyone else get super annoyed that after you type a comma and try to return to a new line it is automatically suggest a new column, so hitting return just inputs this suggested column instead of going to a new line? Anyone
    • Stop adding Default ID column to xls exports

      When anything is exported to xls, Zoho adds a column with an ID. WE DO NOT WANT THIS COLUMN. We use an automated report to a team. We have our own tracking number. 1. This makes the report messy, it just pushes OUR data off to the right. 2. We have to
    • communication distribution

      Hello community! Request for help - how to resolve the issue of subscribing to specific content. I use ZOHO CRM and ZOHO CAMPAIGNS to send email communications to my customers. I only purchased ZOHO CAMPAIGNS after using the CRM for some time and I have
    • Truesync for Linux

      Is Truesync available on linux ?
    • Web access blocked

      Hello, My account (chris@thewebprojects.com) has been blocked due to security reasons. Please see attached. Can you kindly please help me. Thank you in advanced
    • How to determine ZohoCreator organization ID

      I am trying to setup an API to interface with my ZohoCreator app by following the self-client credential flow here https://www.zoho.com/accounts/protocol/oauth/self-client/client-credentials-flow.html However, it requires me to input my organization ID.
    • Autofill Zoho form with Zoho campaign data

      Hello, I send campaigns and we have set a button called "Demo" in that campaign. This button leads to a form. Since we have the data in Zoho Campaign, would it be possible that some fields of the form (first+last name, email, company) are automatically filled when our readers click on this button? If yes, how could I do that? Thanks Aurélie Leyendecker
    • Need to be Amount Adjusted with same Group Comany

      Dear Sir/ Madam, Good Day, Example wise i write my quire Below A B C & D E F Bothe are Same Group Companies We Paid 50000 AED to ABC Company but we received Invoice 48000 AED worth of material Balance 2000 AED invoice i received from D E F. I Need to
    • Transfer between 2 accounts in forein currency

      Hello, While abroad, I have exchanged some money in a money exchange service from a foreign currency (MYR) to another foreign currency (USD) without passing through my base currency (CHF). How do I record this transaction in Zoho Books? When I try to
    • Zoho Books Webhook in Custom Module doesn't work

      I have a custom module "Purchase Request" in Zoho Books in which we're trying to convert status of the PRs to Draft and Pending Approval. We've explored different applications and custom functions but found that the status is not "writable". However,
    • Issue with Missing Scope for Creating Service Report via Zoho FSM API

      Hello @Latha Velu , I am currently working on creating a connection to create a Service Report in Zoho FSM using the API. However, while configuring the required scopes, I noticed that the scope ZohoFSM.modules.ServiceReports.CREATE which
    • Imap Support?

      Does Zoho Books support IMAP? I have enabled outlook integration from settings in Zoho Books Yet the emails I send from Zoho Books for example if I email a purchase order or an invoice I dont see them in it in my sent box in outlook Is there a problem
    • ADDING FUEL SURCHARGE & HST

      Hello I need to invoice the customer showing both Fuel Surcharge & ON HST separately. The FSC should be 20% of the subtotal. The HST should be applied to sum of Subtotal + FSC So it should be like: SUBTOTAL: 100.00 FSC (20%): 20.00 HST (13%): $15.60 How
    • Zoho Project API search?

      Good day, i would like to search our entire portal for a task using the API. We have over 20k tasks so I dont to search for all tasks and then do a for each as it would take way to long and also would need to go over the limit of 200 records per query.
    • Handling Deposits to Vendors and how to book this

      Our scenario: 1. We rent equipment from a renting company for a project (Vendor "Eurorent") 2. We receive an order confirmation with a request to pay a deposit of € 1500. (this is not a Bill) 3. We pay a deposit of € 1500 for the equipment. 4. After using
    • Tip of the Week #61– 5 easy ways to declutter your inbox!

      Managing a shared inbox is easier than you think. With the right tools and a smart approach, your team can stay on top of every conversation, collaborate more effectively, and deliver timely responses without any unnecessary back-and-forth. Here are 5
    • Vertical Solution Zoho One

      Hello, is it possible to create a vertical solution for Zoho One? Just like it is possible for Zoho CRM?
    • Multiple workspaces with in Bigin CRM

      As a freelancer working as a sales representative for two companies, each with its own email address, I would like to know if it’s possible to have two separate workspaces in Bigin. This way, I could manage each company and its contacts independently,
    • Allowing subqueries in FROM clause

      When building a Query table in Zoho Reports, I encountered an error when attempting to put a subquery in the "FROM" clause of my statement.  Why isn't this currently supported?  Is there a plan to implement this functionality in the future?
    • CRM for Everyone - More Actions Option to Create Record

      Please consider the option create a new record for the module from the More Actions menu. I know there is an "Add New" icon further down the menu to create a record for any module, but this just seems more intuitive and could reduce the need for the "Add
    • Zoho books partners: Transferwise, Resolut

      Can anyone tell me if Transferwise and/or Resolut (payment systems) are in integrated?  I know PayPal and Google are, but in Europe we like Transferwise and Resolut is an up and coming multi-currency app. Xero and Transferwise are fully compatible. Thanks
    • Getting oauth errors on bigin

      Hi Support, I'm getting oauth errors on bigin even though it works fine with CRM. I created a self client which will add contacts. I gave every permission you could and it still didn't work. What should I do. I might just switch to the standard CRM since
    • Assessment Field in Custom View

      Zoho recruit finally added the ability to filter Job Applications by Assessment Answers This is a very valuable addition to the Recruit But this is currently missing from the custom view This should be added to the custom view as well
    • Next Page