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

    • Events on Calendar disappeared

      hello, Events (e.g. repeating events) disappeared on my calendar for Wed, Oct 2, which led to missing some meetings on that day. What exactly is wrong? This is not the first time this is happening! Please, fix this calendar issue.
    • FICHIER FEC - ZOHO BOOKS

      J'ai testé le fichier FEC, disponible depuis quelques semaines dans zoho books pour les sociétés françaises. C'est une grande avancée car nous allons enfin pouvoir importer facilement (sans avoir à réaliser de complexes rapports dans zoho analytics) la
    • ERROR CODE :550 - Your message to <xxx@xxxxx.xx> was classified as SPAM.

      Hey Team, I'm using Zoho Mail with my own domain, and from some of the recipients I'm receiving following error message: ERROR CODE :550 - Your message to <xx@xxxx.xx> was classified as SPAM. Please add more content, cut down on HTML links, use fewer
    • Allow 3 Subforms in a custom module

      We have many custom modules in CRM and every now and then we need more than 2 subforms for a module We are on Zoho One Plan Can you please increase the subfrom limit from 2 to 3 Our current workaround is to create a solution in Zoho Creator and embed
    • Time Zones

      Hello, Is there a way to add a time zone in a Deal related to "bid due"? We work on projects across the world and even though some things adjust to my own time zone, I have found that any dates we manually enter - Bid Date, RFI Due Date, etc. do not appear
    • Create Zoho Project and assign a contact without account

      I’m trying to automate the creation of new projects in Zoho Projects using Zoho Flow. In my setup, I often need to assign projects to individual contacts who don’t have an associated Account/Company in Zoho CRM—just a personal contact. When I create a
    • Update main form's Lookup value following the completion of a Subform within that same main form

      Hi, It's quite a simple request but I'm struggling with getting the deluge to work smoothly. In short, I have a main form (Place_New_Order). Public users will be able to use it. They have a subform to complete with their contact details etc (name, email,
    • ZOHO LOGIN PROBLEM

      Hello, my name is Bernice. One of the users in our company is having a problem logging into their system. They had two-factor authentication on their phone but unfortunately, they lost that phone. Now when trying to login to their Zoho people they are
    • New in CRM: Dynamic filters for lookup fields

      Last modified on Oct 28, 2024: This feature was initially available only through Early Access upon request. It is now available to all users across all data centers, except for the IN DC. Users in the IN DC can temporarily request access using this form
    • Sync Zoho CRM Events with Google Calendar?

      Hi, Is there a way to permanently sync all events from Zoho CRM with Google Calendar? I’ve seen that you can link Zoho CRM to Zoho Calendar and then connect Zoho Calendar to Google Calendar — but is there a way to sync existing and future events from
    • Pre-fill webforms in Recruit

      I don't want to use the career site portal (as I have my own already), but I would like to direct users to the application forms for each role, from my website job pages. Is there a way to pre-fill fields in Recruit application forms, so that I only have
    • image cover div or original aspect

      I changed my app's theme, and now when I return to the original theme, the images in my reports cover the entire div, whereas before they were displayed in their original aspect ratio. How can I change this? I can't find the option. I only see that you
    • Delete subform rows based on mainform input

      I took my first adventure in getting ChatGPT to write some code for me this weekend. I want to ADD new rows, UPDATE existing rows and DELETE existing rows based on the input of a mulitselect lookup in the mainform. ChatGPT produced this for me which seems
    • Des parcours WhatsApp simples pour engager vos prospects et les convertir durablement

      En tant que professionnel du marketing, il vous est sûrement arrivé de déployer des campagnes par e-mail, SMS, réseaux sociaux ou pop-ups, sans obtenir l'engagement espéré. Une situation frustrante, mais malheureusement fréquente. Vous vous posez sans
    • [Free Webinar] Learning Table Series - Smart Visitor Management with Zoho Creator—Built for Every Industry

      Hello Everyone! We’re excited to invite you to another edition of Learning Table Series, where we showcase how Zoho Creator empowers industries with innovative and automated solutions. About Learning Table Series Learning Table Series is a free, 45-60
    • Query about error on flutter build for android

      I am having this error when building flutter for android. https://pub.dev/packages/apptics_flutter i followed the instructions here, modified to work on gradle version 8
    • 【参加無料】6月ユーザー交流会 参加登録 受付開始(東名阪の3都市開催)

      ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 6月に東京 / 大阪 / 名古屋の3都市でユーザー交流会を開催します! 各地域のユーザーによるZoho 活用事例や、自社活用・運用について参加者同士で情報交換が出来るグループワークなどを予定しています。 ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー ※以下、記載順で開催予定 🟠 大阪ユーザー交流会 6/5(木) 18:00-20:20 ・会場:APイノゲート大阪 ・予定セッション ┗Zoho サービス活用事例:Zoho
    • Zoho Books Payroll

      How am I supposed to do payroll and pay my employees with Zoho Books? I think it's pretty strange that an accounting software doesn't have the ability to perform one of the most common functions in business; paying your employees. Am I missing something,
    • Zoho Finance Workshop 2025 is Happening Now!

      Hello everyone! 👋 We’re thrilled to announce that the Zoho Finance Workshop 2025 has officially started, and we've already wrapped up the event in Chennai, our home ground! After an amazing session, we're geared up to visit more cities in India and take
    • 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
    • DKIM cannot be enabled for the domain as no verified default selector present

      Can't get the DKIM working. May you please check my account (nksy.us) to see what's wrong?
    • Will Cliq support Streaming for AI / LLP resposne

      Currently LLM APIs stream the LLM response token by token, since waiting for the entire response takes usually ~ 7-10 seconds. Is there any intention in supporting streaming in the Cliq platform? Namely, I'd like to build a chatbot in Cliq and I want
    • Email address with + char is incorrectly invalid

      cannot enter contact with email address containing +, i. e. valid+email@example.com. this is a perfectly valid email address by but fails Zoho Campaigns validation. https://en.wikipedia.org/wiki/Email_address#Local-part
    • Amount Change -> Reason of update

      How can I setup the CRM so whenever the Amount field is being changed, the user who changes it needs to fill in a reason of change -> Could be a Subform entry or even a note. I'm happy to use any of available features -> Workflows, Functions, Buttons,
    • Zoho not receiving verification email.

      I developed a website registration page and need to send verification email. I am using sendinblue for sending out the verification emails. Somehow, the mail is not being received by the Zoho users. Gmail, outlook, yahoo domains works fine but when I try to send the mail to my Zoho account I am not able to receive the mail. Can you please let me know what might be the issue?
    • How to Save Token in CRM

      Hi, Is there any method that allow user save their token in CRM, otherwise I have to get token every time the function run.(Token expire each day)
    • Any simple way to setup an automation from Facebook Lead Forms to Zobot taking care of the conversation?

      Right now i have a simple setup live with Make.com sending a Whatsapp template message from Twilio to a Lead received from Facebook Lead form then a ChatGPT bot taking care of the conversation. But no CRM On SalesIQ i can't find a way to start a conversation
    • Automation#22 Track Ticket Duration at Specific Status

      Hello Everyone! Welcome back to the Community Learning Series! Today, we explore how Zylker Techfix, a gadget servicing firm, boosted productivity by tracking the time spent at a particular ticket status in Zoho Desk. Zylker Techfix customized Zoho Desk’s
    • Cliq 1.7.5 status icon doesn't update if there are unread messages

      Cliq 1.7.5 System: Ubuntu 24.04.2 LTS x86_64 Installed from the .deb package (cliq_1.7.5_amd64.deb / MD5: 10c5924911a2e90af012d564da670bf8) GNOME 46 Whenever I get new messages the status/notification icon remains unchanged (white icon without the red
    • Is there a way to customize the style of the success message - Advanced Web Form

      Is there a way to customize how the success message is displayed after a Zoho webform is submitted? We’d like the success confirmation to match the visual style and branding of our website, so we're looking for options to either apply our own CSS or replace
    • Zoho Desk app update - Initiate WhatsApp chat with pre-approved templates from ticket and contact details screen

      Hello, everyone! We are excited to introduce an option to send WhatsApp messages via IM(Instant Messages) using pre-approved templates directly from the ticket and contact details screen of the Zoho Desk app. In the ticket details screen, we have enhanced
    • Where to view user feedback on answer bot's "was this helpful?"

      We are trialing answer bot in our knowledge base and like what we see so far. One of the things we like is that upon answering a query, answer bot asks "Was this helpful?" (see attached). As part of our trial we've been responding to this by clicking
    • Is there a way to have a "Time only" field?

      I need a field that only captures the time.  I don't like the Date-Time field.  It is very clumsy for the user to input AND I need to sort by time separately.  PLEASE add a new field that is dedicated only for inputting time.  I don't need seconds just hours and minutes.  Bonus would be to change it from AM/PM to military/international time. What do we need to do to make this a separate field???   I don't want a work-around, I just need the field.  Is there someone out there that knows how to create
    • CRM Mail Merge Template copies OLDER version of the document instead of most recent version

      I have to make 60+ Mail merge templates in ZOHO CRM to use for editing in WRITER and then sending on to sign for signatures. So I have been working on 1, setting all the styling and automatisation right, and I want to use this one as a master template
    • Zoho Sprints Mobile 2.0 : La gestion de projet, réinventée pour vos déplacements

      Nous avons le plaisir de vous annoncer la sortie de Zoho Sprints Mobile 2.0 : une version revisitée de notre application, avec une interface modernisée, de nouvelles fonctionnalités puissantes et une navigation optimisée. Grâce à cette mise à jour, gérer
    • Allow Portal Users to log in using their mobile number.

      I want to allow portal users to log in using their mobile number. I referred to below documentation, but it mentions that this is only supported for Indian mobile numbers. Is it possible to enable login using a Singapore mobile number? https://help.
    • Zoho Webinar Android app update - Organizer chat

      Hello everyone! In the latest version(v1.4.0) of the Zoho Webinar app update, we have brought in support for the 'Organizers' chat feature. In addition to the existing public chat, co-organizers now have access to chat separately with organizers and attendees,
    • Task Due Time - Unable to Add

      I have taken a trial version to test, I could not find “Due Time” feature. Only Due date is given
    • Sign - Introduce a feature to make fields required based on conditions

      Add "Required" to conditional options for fields. Example: A Sign document contains 2 fields Company Type (picklist) Company Registration Number When "Limited Company" is selected from the Company Type, the Company Registration Number should become
    • Connect Zoho Creator on on prem database with databridge.

      Hi im new to zoho creator. Been through many forums and training clips but cant find a solution. 1. I have an on prem mssql server called "Sales" with a tabel called "Monthly" the server address is 10.0.0.10 2.i have Databridge installed on the server
    • Next Page