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

    • Can I embed Zoho Project in Zoho CRM Record Detailed View

      Hello all, We use Zoho Projects a lot. The integration of Projects with Accounts and Deals only is great, but very limiting to our needs. Is it possible to either: add a project to related lists to custom modules - similar to how it is automatically added
    • COMPLAINT : Sleeping & Useless Support Team. GMail is better then..

      [## 118256452 ##] License upgrade issues: As a reseller, I tried to upgrade 1 license for my customer. It shown error. Raised complaints via Email/Chat/Phone support. Its been more than a week, still keep asking damn questions and comfirmations on once
    • Introducing the Reviews sub-module in Zoho Recruit

      Across every recruitment process, candidates are assessed by multiple stakeholders—recruiters, interviewers, hiring managers, and clients. These evaluations influence hiring decisions, yet they often exist in silos across assessments, emails, or interview
    • Unable to add a organization with US location

      I have created a Zoho Books trial account and since I am using Zoho People and payroll, Zoho Books has taken my existing credentials and created an Indian entity, but I am not able to add a US entity. How to add a US entity?
    • Two-Way Sync Zoho CRM Custom Module with Zoho FSM Company Addresses

      Business fact: Many companies don't just have one location. They have multiple locations (some have many), with addresses we need to know for service, deliveries, etc. We have created a custom "Sites" module in Zoho CRM to store an Account/Company's addresses
    • Meet the latest feature of Zoho Sheet: Lock Cells

      We are happy to announce the release of one of the most awaited features in Zoho Sheet. ​You can now lock the cells that you wish to keep ​secure. Once you are done with editing cells, you can lock them so that they won't be modified anymore. We believe that this feature will be a great addition to our existing set of collaboration features and is intended to improve your collaboration experience. You can access this new feature Lock from Data tab. Apart from being able to lock individual cell ranges,
    • Error message when creating group

      I get two error messages when creating a group. One says it already exists, but it doesn't not already exist. See screenshots.
    • What are the benefits of procurement software in a growing business setup?

      I’ve been exploring tools that can help automate purchasing and vendor-related tasks. I keep hearing about the benefits of procurement software, especially for businesses that are scaling. I want to understand how it helps in streamlining operations,
    • Add Desk Account comments using Flow

      The triggers and actions for Zoho Desk available in Flow are quite extensive, but I don't see anything related to Account-level Comments. There are actions to add comments to Tickets, Contacts, Tasks, and Topics, but nothing for Accounts. Am I missing
    • workflow field update will Not triggering another workflow rule

      I have a Workflow rule that is supposed to get triggered when a field is modified to certain value. This field is actually the lead status and when the lead status changes to "Client Not Responding" . I have a series of emails that go out to re-engage
    • Critical Feature Gaps Between Zoho Books and Zoho Finance Module in CRM

      We are extensively using Zoho Finance Module in our organization because of The Record Sharing feature provided by CRM something thats not possible in Books, we are able to limit what Sales Orders, Purchase Orders, Estimates an employee can see based
    • Disable Refresh, or hold info after refresh.

      Is there a way to hold the info entered in a form if the page refreshes, or to disable refresh of the form.
    • changing the Delivery Challan Heading

      Hi We want to change the Delivery Challan Heading as per our requirement. Like Returnable/Non Returnable/Delivery challan. But it is not happening here. is it possible to change advise. Thanks Radha
    • ZohoCRM上での接触回数の集計や評価について

      当方toB営業を行う会社なのですが、 顧客ごとの接触手段と接触回数を蓄積してKPIや評価指標としてレポーティングしたいのですが、どのタブでどのような運用をするのが適切でしょうか。 商談タブ、取引先タブ、連絡先タブそれぞれにおいて運用方法を考えましたがイメージが湧かず、ご教授いただければ幸いです。
    • 【Zoho Backstage】2025年4月のアップデート紹介

      本投稿は、本社のZoho Desk コミュニティに投稿された以下の記事を翻訳し、一部抜粋したものです。 What's New - April 2025 | Zoho Backstage ユーザーの皆さま、こんにちは。コミュニティチームの中野です。 本投稿では、Zoho Backstage の直近のアップデートを4点抜粋して、ご紹介します。 目次 1.参加者リストのエクスポート 2.予約メールに添付ファイルを追加 3.セッションの詳細を登壇者のメールに追加 4.登録フォームへの日時(Time)項目追加
    • Record template - How to format a table

      HI, I have a table in my form. I want to extract that in to my record template as a comma separated list - anyone else tried this? e.g. My Form... row1 value1 row 2 value2 " " My Template: my rows contain: val ue1, value2
    • Allow reconciliation for bank acct with no transactions for month

      Is there a way to allow a bank reconciliation to take place when there are no transactions for the month? I am unable to create a reconciliation for the month because there are no transactions to select. I want to be able to attach the bank statement
    • error while adding a domain

      I am adding a domain to admin console but they're showing this kind of error! pls help me with this.
    • Multiple barcodes and sku aliases

      Hi, It would be great if you could add the following features: Allocating multiple barcodes to a product as sometimes different barcodes are in circulation in a particular market. As well as different barcodes, sometimes, different SKUs are used by different
    • Video Interview features

      I tested the video interview feature. It's supported only on desktop version of chrome/firefox. Most of the times, the candidates are available on their cellphone. Need to have this for mobile devices too.
    • Different Domain Name Sync AD Password to Zoho Mail

      Hello, may I ask if how to configure or is possible to sync AD password to Zoho mail? Example AD domain name is xaxis.net and zoho mail domain name is yaxis.net.
    • Announcing New Features in Trident for macOS (v.1.19.0)

      Hello everyone! Trident for macOS is here with interesting features and enhancements to elevate your workplace communication. Let's take a quick look at them. View and manage .pst files. A .pst (Personal Storage Table) file is an Outlook Data Storage
    • Creating Email template that attaches file uploaded in specific field.

      If there's a way to do this using Zoho CRM's built-in features, then this has eluded me! I'm looking to create a workflow that automatically sends an email upon execution, and that email includes an attachment uploaded in a specific field. Email templates
    • User manual as PDF

      Hi, on the User Manual pages (for CRM, Support and other Zoho Apps) is a print button, but mostly the pages contain only links to other pages. So, printing the manual is of no use. Is there any PDF version of the FULL manual? Or any other source where
    • Custom Field for Subscription

      Hi, I can't find a way to add a custom field (to contain a license key generated from our software) against a subscription? Is the only place to add this information in the Invoice module (as custom field for invoice)? When a customer views his subscription via the customer portal, there appears no way to display a license key for them? The invoice is not the natural place to store a license key for a particular subscription, so where else can this be stored and displayed?
    • Disable fields in multiple subform rows

      Hello everybody! I have an odd one here. I have a subform that collects hours of operation. It contains these fields: Days, Type, Open, and Closed. On load of the form I add 7 rows with Mon - Sun in the Days field. I then disable that field and the add/delete
    • Deal Product reference

      Hello All, I'm trying to use Zoho Writer to dynamically create a statement of work document. Our statement of work is heavily dependent on what products are included in the deal. As such, I need to be able to add or remove sections of text depending on
    • How to record the Customer Payment received against previous year invoice

      Hi . How to adjust the receipt of this payment in customer account statement received for previous year invoices, which are not there in the statement with us. Because it is showing as prepaid expenses or unearned revenue Advise Thanks radha
    • Discripency in inventory adjustment value and FIFO cost lot tracking report report

      In zohobooks, I have added 200 bag of itemA with unit rate is Rs.1408 as opening stock on Apr01/2025, after that i make a inventory adjustment for 100 bag that I transfer to stock in process account, after that I make a purchase bill for the same item
    • How do I add todays date to merge field

      I don't see any selection of todays date when creating a letter.  Surely the date option of printing is standard? John
    • Zoho FSM API to search Zoho FSM Assets by Asset_Number?

      How can I search or otherwise retrieve an Asset from the Assets module in Zoho FSM using the Asset_Number? The API docs seem to say that the only field that can be searched is the Asset Name. Is this true? https://www.zoho.com/fsm/developer/help/api/search-records.html
    • Sync Creator form submissions to WorkDrive folder

      I've made 10 Creator applications, and need to sync my each application's submissions into a WorkDrive folder. I need the form submissions to be PDF file type and sync to a specific folder for documentation purposes. I have tried to use a workflow, but
    • Add Voting Polls Feature Similar to WhatsApp to Zoho Cliq

      Hi Zoho Cliq Team, Hope you're doing well. We are using the Voting Polls feature in WhatsApp (see: WhatsApp Voting Polls FAQ), and we believe a similar functionality would be extremely valuable in Zoho Cliq. Currently, when our teams want to quickly gather
    • ZML Snippet: Auto Refresh Section

      Is there a way that I can set an auto refresh on each of the ZML snippet only and not the entire page? Just wondering..
    • Availability of the Custom Sort Order feature for Windows and Mac platforms??

      Notebook Team, I hope this message finds you well. I am reaching out to inquire about the current status and planned updates for the Custom sort order feature within your application. A year ago, it was mentioned that this feature is supported on iOS,
    • Have you checked your Email headers for DKIM Failure?

      Have you taken a look at your email headers for DKIM failures even with DKIM set up properly? I've had DKIM successfully set up for many months. My account currently shows Email Verified and Authenticated. Big green check marks. Email Relay is also showing
    • Wizard Form

      I would like the option to create a wizard that works when you create a record and contacts that are already in the CRM captured with a web 2 lead form (field data inserted in to the wizard).  Having the option to create up to 3/4 segments per screen
    • Pivot Table - Zoho Analytics

      I'm creating a Profit and Loss chart in Zoho Analytics using the Pivot Chart feature. While Net Profit can be calculated using the total value, I also need to calculate and display the Gross Profit/Loss directly within the chart. To do this, I need to
    • Fetch function not working for CRM Contacts

      I've created a flow that checks if a contact exists in CRM (based on form input), and if it does, then it updates one of the fields for the contact. In my test, the fetch function correctly identifies that a contact exists (based on email address), but
    • Clone a project

      To whom it may concern, I did a quick search of the forum and found nothing relating to this idea, so am posting fresh. The service that our company provides means that we follow an essentially identical process for each new job, and this includes the time frames for each stage. Ideally we would have a complete "template" project, with all the task lists and tasks in place with associated start dates, due dates (and by extension, duration) and - most importantly - the dependencies between tasks so
    • Next Page