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

    • Nifty enhancements to Reports in Zoho CRM

      Dear Customers, We hope you’re well! We are here with a line of useful enhancements to Reports in Zoho CRM that are readily available to access. Include or exclude Record ID in the report export Display currency fields in record currency Capture report
    • need a formula to return value as shown (zoho sheet)

      Dear folks, What should be the formula in cell B3 to get that output, based on input sheet data.
    • need a formula to return value as shown (zoho sheet)

      Hello folks, what should be the formula in B3, to get the value shown based on input sheet ranges. thanks in advance.
    • Playground: An exclusive test environment to analyze Field Prediction accuracy

      Hello everyone, We are introducing Playground: an exclusive proactive testing environment for businesses to analyze Zia's prediction accuracy. This allows admins and agents to: Run predictions on actual tickets or specific content for realistic test conditions.
    • Attention: Upcoming changes to Zoho Assist support for older windows versions

      At Zoho Assist, our goal is to provide you with secure, reliable, and feature-rich remote support experiences. To maintain this standard, we periodically align our platform with the latest technology and security updates from the broader software ecosystem.
    • Send again email with link for signup

      Hello, I have a lot of problem to send contract my email, also missing the features "share link". How can I send again email to client and me wit link for signup a contract? Everytime it's a disaster!
    • How do I synchronize a quote to an opportunity?

      Hi everyone, We don't quote anything via Zoho but we use it to track services/products so that I can see what was actually sold, vs an opportunity with just shows an amount.  We use the quotes for other purposes, mostly to request a quote from Salesforce but we don't invoice or do sales orders or anything. (Basically a user makes a quick quote in Zoho, adds items and pricing, and then exports to PDF which gets emailed to our Quote Desk who then enters the request into Salesforce). Just wondering
    • Zoho Sprints Android app update: Tags and Epic search

      Hello everyone! We are excited to introduce tags and an option to search items within Epic module on the latest Android version(v2.0.2) of the Zoho Sprints mobile app. Let's take a look at these features: Tags You can now create, edit, and delete tags,
    • Zoho CRM Webhooks - Dynamic URL

      Hi Zoho, We've noted a gap in the webhooks function that if improved would increase use cases significantly. The "URL to Notify" field in "Create a Webhook" only supports static information. We have a number of use cases where we could use webhooks more
    • Work Order Creation Issue

      Dear Team, I would like to inquire about the daily limit for Work Order creation in Zoho FSM. Yesterday (02/05/2025) at around 6:30 PM GST, I attempted to create a Work Order, but I have been unable to do so since then. Please find the attached image
    • Tracking on Zoho Booking

      Hi We want to use Zoho Booking for our appointment management. We're using Calendly as of now that lets us track sources of the appointments made including UTM parameters. Is there a way for us to do same with Zoho Bookings?
    • Pre-created Popular Zoho Flows returns with 404 Error

      Your popular Zoho Flows are returning with a 404 page error. This applies to all work flows in your Gallery Space. See video here for further clarification. When will this be fixed? https://drive.google.com/drive/folders/1kDl4ni5EQeLHWeaoIDdtRqoUbW8FNLfO?usp=sharing
    • CRM Feature Request

      When enabling Translation in Zoho CRM I would like to see the ability to remove the language "English (US)". I have encountered a user experience issue with a client recently. The client uses English (UK) but they are based in Spain, so they have activated
    • Import your Google Docs Spreadsheets into Zoho Sheet

      You can now import your Google spreadsheet into Zoho Sheet. This will be useful if you want to switch to Zoho Sheet or if you want to simply try out Zoho Sheet.  If you don't have an account with Zoho, you can still try this by signing in with your Google account. Here is a video on how to do this.  Note: Existing charts won't appear in spreadsheets you import from Google Docs as the Export functionality of Google Docs doesn't give out the charts. Check out the announcement in our blog: https://blogs.zoho.com/general/import-google-docs-into-zoho-productivity-suite
    • Support Mixed Visibility Settings in Knowledge Base Categories

      Hello Zoho Desk Team, We hope you're all doing well. We’d like to submit a feature request regarding visibility settings in the Knowledge Base module. 🎯 Current Limitation As of today, when a category is set to a specific visibility level (e.g., Public),
    • Will a campaign send duplicates is same email is on two separate lists

      Hi I have two lists to which I want to send campaign. One list is ALL leads and other is list of opportunities and current students. There is overlap between the two lists My question is if I send one campaign to all, will zoho automatically know only to send the email once to the duplicate email?
    • Time Based Report / Dashboard

      We measure our support agent's KPI based on their response time and resolution time from the time the ticket is assigned to them The time based dashboard should provide this information however there is a problem with us referring to this dashboard We
    • Zoho Learn API Access?

      We love using Zoho Learn to manage our internal trainings and knowledge base. What we'd really love is to be able to query Learn via API so that in Zoho Projects, Zoho Creator, or Zoho Desk, we can recommend relevant Learn articles and manuals to team
    • creating buttons in zoho site

      the connection between zoho site and zoho learn will be awesome and amazing feature so the user instead of registering himself twice just one time register on zoho site will be enough and creating accout on zoho learn instead of registering on zoho learn
    • Two Problems with the Description Field

      Our ticket workflow is often like this. Client calls or emails (to a personal email address) reporting a problem. We create a ticket and enter a description. Problems: 1. By my way of thinking when we enter a description, that is an internal comment (unless we mark it public). Yet it seems there is no way to mark it internal, and Desk just starts inserting it into communications. 2. Additionally, in the conversation view it makes it appear it was emailed by the customer and inserts their name on
    • Lookup Field limitations

      Good day all, Is anyone else frustrated with the lookup field limitation? I have an enterprise license, but I only get 10 lookups. Additionally, the custom module has been available for a while and is still in diapers. If you want good reporting, you
    • Automation#36: Auto-create time-entry after performing the Blueprint transition

      Hello Everyone, This week’s edition focuses on configuring a custom function within Zoho Desk to streamline time tracking within the Blueprint. In this case, we create a custom field, and request the agent to enter the spending time within the single
    • Dynamically Sync zoho.adminuserid with Current App Admin

      Hello Zoho Team, We hope you're doing well. We’d like to request an important enhancement to the Deluge sendmail task functionality. As per the current behavior, in most Zoho services (excluding Zoho Cliq, Zoho Connect, Zoho Mail, and Zoho Sheet), the
    • "Improper Statement" Error on Deluge Loops (while/for) when Processing a Date Range

      Hello, Zoho Community, I'm facing a very specific issue with a Deluge script and would appreciate any insights from the community. The Goal: I have a form (ausencia_visitadoras) where a user inputs a start date and an end date for a period of absence.
    • Zoho Meeting iOS app update: Hearing aid, bluetooth car audio and AirPlay audio support.

      Hello everyone! We are excited to announce the below new features in the latest iOS update(v1.7.4) of the Zoho Meeting app: 1. Hearing aid support: Hearing aid support has been integrated into the application. 2. Bluetooth car Audio, AirPlay audio support:
    • Automating Daily Lottery Result Publishing with Zoho Creator or Flow – Any Best Practices?

      Hello Zoho Community, I run a results-based informational website in Brazil called CaminhoDaSorte.com, where we publish daily Jogo do Bicho results. Right now, we're doing this process manually every day — but we’re looking to automate the backend using
    • issues with manually shipping sales orders - advise needed please

      we are new to zoho inventory. we are going to roll the program out to our company within a couple of weeks and during the implementation process we have come into a roadblock with manually packaging and shipping sales orders. its important to note important
    • I do not see the “Lead Forms” option under Integrations

      Hi, I’m using Zoho Social on a Premium plan. I’ve connected LinkedIn Company Page and have a valid LinkedIn Ad Account with Lead Gen Forms. However, I do not see the “Lead Forms” option under Integrations, so I can’t enable LinkedIn Lead Generation. Please
    • STOCK function showing #N/A! even thought the Stock symbol is valid

      Zoho Team, I use STOCK function on Zoho Sheet to fetch the recent Last Closing Price. Some stock symbols are valid but when the STOCK function is applied, it shows #N/A! Attaching an image for reference.
    • What’s the Correct Integration Flow Between Zoho Inventory, ShipStation, and Multi-Channel Sales Platforms?

      Hi Zoho Community, I’m currently implementing Zoho One to manage all of my business processes, and I’d appreciate some guidance on the correct integration flow for the tools I’m using. Here’s my current setup: Zoho Inventory is my central system for managing
    • Beyond Email: #4 Note taking done right with Notes

      With her favorite links now saved in Bookmarks, Sarah is feeling even more at home in Zoho Mail. As her day fills up with meetings and project discussions, she often finds herself scribbling quick ideas and reminders—only to lose track of them later.
    • When will Sales Order and Invoice Synchronisation with Zoho CRM be Available?

      When will Sales Orders and Invoices, created in Zoho Books or Inventory be made available in Zoho CRM? John Legg Owner: The Debug Store
    • Generate Unique Customer ID for Each for All Contacts

      Generate Unique Customer ID for Each for All Contacts
    • Bookings to Books automation using Flow

      I'm using Zoho Flow to automate a process between Bookings and Books. When someone uses Bookings to schedule time with me I use Flow to automatically add the person as a customer in books, then create a Quote in Books for the type of consultation they
    • Different Canvas for Different account type

      I would like to have a separate canvas for Customers and Resellers that auto-applies when I enter an ACCOUNT. Is this do-able?
    • IMAP sync issues in Zoho CRM

      We are using the Zoho CRM for a while, and we sync (via IMAP) our Google Apps email system. The sync works properly when looking at emails per account, contact or deal, etc. However, it does not function well in the "Messages" and "SalesSigns" features.
    • Reporting tags for custom modules

      Hi, it could be very useful. At field level and at sub table level. Thanks, Eduardo
    • Can't pass Dates and use date filtered Charts in Pages?

      I don't mess with pages very much, but I'm trying to build a dashboard. I have a search element and several charts that need to be filtered. I also have a stateless form for a start/end date picker I am trying to use to filter data for the charts. Here
    • ZOHO FSM Trial - Assets

      Hi I am currently using Zoho CRM and looking at adding FSM. I am trialing FSM at the moment, to potentially move away from my current programme (SimPro) but have a query on the Asset system within FSM It looks like you can only create 1 asset "type";
    • Customize User Invites with Invitation Templates

      Invitation Templates help streamline the invitation process by allowing users to create customized email formats instead of sending a one-size-fits-all email. Different invitation templates can be created for portal users and client users to align with
    • Next Page