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

    • Zoho Inventory Amazon Integration

      The Zoho Developer Account is not valid for Amazon UK and returns this response whilst set up: This Developer Account Number 861444729264 is not valid for the GB marketplace
    • Sales by Customer

      Hi There, I am looking to generate a report that shows the total value of the sales made to our customers, but does not show each transaction i.e. Customer A = $100,000 Customer B = $50000 and so on This is based on a "Closed Won" in the Deals Module.
    • Enhance Bot Functionality for Scheduled Reminders

      Dear Zoho Cliq Team, We are writing to request an enhancement to the bot functionality within Zoho Cliq. Currently, bots can be added to channels and send messages, but they lack the ability to schedule reminders. Our team utilizes a deluge code to send
    • Zoho Expense - Update Expense Report through web API

      Hello, I am currently having issues updating fields in expense reports (not individual expenses) through the API as described in the API documentation. When I make that request using the invokeAPI Deluge function, I receive a response from the API saying
    • How to switch templates in Zoho Commerce

      I have set up a template in Zoho Commerce and would like to change it. How do I do this?
    • How to use filters on all products page? Or even a category page?

      Hello, I am trying to create some filters so users can use filters to find products they are looking for. So what i am trying is to create a filter according to price lets say. So if i define it this way i am expecting to see this filter option on category
    • How to show product categories on side menu?

      Every time I add a category it appears on the main menu. I would like the main menu for things like contact us, blog etc.. and a side menu to the left of the screen for product categories. How do I make them appear in a side menu or even in a category
    • How to Add Custom Sections in the Product Page?

      Hi Zoho team, I’m currently using the Tranquil theme on Zoho Commerce and I have a question regarding the product page layout. Right now, under each product, I can see expandable sections like Product Details and Specifications. I’d like to add two additional
    • Unable to validate DMARC for the email

      I have recently started to use the ZOHO CRM tool and I'm currently on free trial period. However, when I tried to test the email, it was landing in SPAM or JUNK folder of the recipient's inbox. I learnt about the DMARC, so i have completed SPF and DKIM
    • Migrating Shopify Customers and Tags to Zoho Commerce

      I’m exploring options for migrating our existing Shopify customer accounts into the Zoho Commerce member portal. Specifically, I have a few questions: API Availability: Is there a public API or supported endpoint that allows us to import Shopify users
    • Multilingual website feature

      Would be a great feature to have. I saw that this feature was available for backstage. I think it could be done for zoho sites too.
    • Feature Suggestion for Zoho Social: Auto-reply to Comments or Keywords

      Hi Zoho team, I'd like to suggest a very specific feature that would be extremely helpful for customer engagement: the ability to automatically send a reply to comments on posts — either all comments or those containing specific keywords. For example,
    • How Can i Add Email campaign for my UAEVisaOnline.center website

      Hello Team, i want to create email campaign for our website https://www.uaevisaonline.center but can't able to add. Its showing error like please try after some time. Can you please help and solve the issue. Thanks!
    • The domain Etihaduaevisa.com which you have entered belongs to a different deployment/region

      Hi Team, I am trying to set up a business email account to Zoho for www.etihaduaevisa.com but it doesn't allow me There is a message that pops out The domain which you have entered belongs to a different deployment/region Kindly assist me with this. Thank
    • Outlook not recognising Zoho Inbound server

      I have been receiving my ZOHO emails using MS Outllok on my iPhone and PC, but since Friday 2nd May, incoming emails are not arriving via Outlook and I get the error message saying the server is 'not responding'. Have ZOHO changed the settings for the
    • Zoho Sign / CRM integration - stop unsigned documents being attached

      I'm using the the CRM/Sign integration to send documents for signature from Zoho CRM. I noticed that an unsigned copy of the document is added as an attachment in the CRM. Is there a way to stop this? I only want signed documents to be attached. The unsigned
    • Resend invite

      Hi, How do I resend an invitation to someone who didn't get the invite the first time around? I tried going to Setup-->User (like it says in the Help) but there was no option to resend. It doesn't display any users who has not accepted the invitation.
    • Asking for implementation roadmap or step-by-step guidelines

      Hello everyone, I'm a freelancer who's been hired to implement Zoho CRM for a client, and I want to make sure I approach this correctly. Could someone kindly share a comprehensive implementation roadmap or step-by-step guide that covers all the essential
    • Asking for implementation roadmap or step-by-step guidelines

      Hello everyone, I'm a freelancer who's been hired to implement Zoho CRM for a client, and I want to make sure I approach this correctly. Could someone kindly share a comprehensive implementation roadmap or step-by-step guide that covers all the essential
    • Approval Workflow for Purchase Orders Abrir

      The requirement is , that all purchase orders greater than or equal to 5000 go through an approval process from certain people, but within books I only see that the approvers can be by levels or any approver but we cannot enter a rule like these. Can
    • Multiple subforms from same existing form

      Hello, In an Order form, I have a subform for Line items. But my items have 5 distinct product categories. To make it pleasant and easy to use, I want to repeat the subform 5 times in the same parent form, to separate my 5 categories of product. But I
    • Announcement: Zoho DataPrep 1.0 will be deprecated on October 31,2025

      We'd like to inform you that the Zoho DataPrep 1.0 version will be officially deprecated as of October 31, 2025. This aligns with our efforts to streamline and improve your overall experience with Zoho DataPrep 2.0 which was released in Sep 2024 . To
    • Discussions from Ask the Experts 19 : Inside Zoho Desk Spring Release 2025

      Hello Everyone, We appreciate the engaging discussions during the Ask the Experts 19 session on the Spring Release. It was a pleasure connecting with you. Our team is actively working towards your requests to deliver an improved experience. In this post,
    • Optimisez la gestion des bots et la conformité à Apple MPP

      Filtrage des bots : une nécessité pour des données marketing fiables Les indicateurs de performance sont au cœur de toute stratégie marketing. Cependant, l’augmentation du trafic généré par des bots ainsi que l’adoption croissante de fonctionnalités comme
    • One time batch workflow to repair omission of data

      Hi, I created a parent form (Product) and another form (Prices) that is used as subform in the parent form. In the parent form I have a field Category that must appear in the subform, but I forgot to create the field at first in the subform and now I
    • Changing a Single-Line Text field into a Multi-line Field without losing data

      Is it possible to change a Single-Line Text field into a Multi-line Field without losing data. I have a module with data for which I would like to change a single-line field into a multi-line field but I'm worried it might delete the pre-existing da
    • Advance Your Churn Predictions with Zia's Usage Data Feature: Event Mapping

      Greetings all, This is an important and exciting update about feeding usage data into Zoho CRM. To expand the scope of how usage data can be used by Zia, we are introducing a new section called Usage Data under Zia. Users can now easily import, edit,
    • Web-To-Quote form would be awesome

      It would be awesome to be able to embed a quote form on a website and have that filter in to Zoho CRM. Account Number to match the Account in Zoho Email address could match the Contact. Product Code could be required to match the product. Not sure about quantity? I am sure this all could probably be done via the API and maybe some middleman interaction with Creator, but it would be nice if it was as easy as the Web-to-Case form. Something like this could lead to further integration with CMS and Shops
    • Published Sheet - Share option to show "Save copy to WorkDrive"

      Hi Sheets Team, I'm currently working on a Zoho Sheet which I want to share with other Zoho users outside of my organisation. Normally I would do this with Google Sheets but I'm trying to make better use of my Zoho tools. When I share a Google Sheet publicly
    • Bills vs. Expenses

      Hi eveyone, Can somebody explain me a little bit better of how can I use Bills and Expenses in my business? I don’t understand their differences to be honest.
    • Integration to LinkedIn Recruiter

      We'd like you to support Recruiter System Connect to sync our LinkedIn Recruiter candidates to the Zoho Recruit ATS. How can we do this?
    • List View just got a makeover!

      Hello everyone, The new list view is being rolled out in phases and will be available to all our users by the end of January 2021. We are excited to announce that the list view in modules is set to get a new look. The new list view is sleek, contextual,
    • Using IMAP configuration for shared email inboxes

      Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
    • Add Video block needs improvement

      I regularly send out links to videos in my campaigns and I find that built in video block is never good enough to use in my campaigns, so I have to make a thumbnail in Canva and upload it or screenshot the actual video on YouTube. The concept of the video
    • Profile cannot add tasks, calls or meetings

      Good morning, I have a Profile of users that's called "Standard2" and their module permissions are set as follows: Despite this, one of my users on the Standard2 profile gets this when they try to add a call: Any idea how to fix this? If i bump them up
    • Zoho Developer Community Monthly Digest – April 2025

      Hello everyone, Welcome to this month’s Zoho Developer Community Digest! We’ve lined up an exciting series of technical sessions, product deep-dives, and community conversations to keep you informed and inspired. Don’t forget to check out our resource
    • Dataprep est-ce que zoho est sérieux ??

      Nous venons encore de passer plus de 2 heures avec le support zoho qui est incapable de résoudre le problème rencontré dans la mise en place d'un pipeline de données entre le C>>RM et DataPrep Celà fait 5 mois que nous essayons de faire fonctionner le
    • STOCK COUNT - How is this even possible

      Dear Zoho One, We have a lot of products from Zoho but I really don't understand this. We mainly use ZOHO FSM with ZOHO INVENTORY because we are in service and maintenance for electric charging stations for cars All employees of Zoho FSM have their own
    • Changing sequence of buttons

      How can I change the sequence of these buttons? I want the 'Versturen referral campagne' to be displayed as the default button
    • Unapproved Articles for Review?

      What is this feature and how do I use it? I'm not seeing any option to mark articles as unapproved and needing review.
    • Next Page