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

    • Add documents/uploaded files in Zoho CRM records that can be accessed by all team members?

      Hi, I'm building out our small business' Zoho CRM implementation and are on a Zoho One plan. We do LED Lighting Projects for customers, and collect data like customer utility bill PDFs, and pictures of existing lighting that we want to keep in one centralized
    • Updates for Zoho Campaigns: Merge tag, footer, and autoresponder migration

      Hello everyone, We'd like to inform you of some upcoming changes with regard to Zoho Campaigns. We understand that change can be difficult, but we're dedicated to ensuring a smooth transition while keeping you all informed and engaged throughout the process.
    • Customizing Helpcenter texts

      I’m customizing the Zoho Desk Help Center and I’d like to change the wording of the standard widgets – for example, the text in the “Submit Ticket” banner that appears in the footer, or other built-in widget labels and messages. So far, I haven’t found
    • Zoho Desk - I am no longer receiving email notifications when comments are made on tickets

      I still receive other notifications via email (e.g., new tickets and replies) - however beginning May21, I no longer receive notifications on comments (whether private or public) - I have confirmed that notifications are toggled on for agents within system/notification
    • Issues with Campaign Results Sync Between Zoho Campaigns and Zoho CRM

      Hi everyone, I’m experiencing an issue with the integration between Zoho Campaigns and Zoho CRM. When I send campaigns from Zoho Campaigns, the results shown in Campaigns (such as the number of emails sent, opened, and clicked) do not exactly match the
    • Greek languge

      Hello, Is there any support for Greek language in the near future?
    • Import records with lookup field ids

      Hi Is anyone able to import records into Recruit via spreadsheet / csv which contain ids as the lookup values. When importing from spreadsheet lookups will associate with the related records if using record name, however when using related records id
    • Custom module history is useless

      Hi I am evaluating ZOHO DESK as my support platform. As such I created a few custom modules for devices assigned to employees. I want to be able to see the whole picture when a device was reassigned to someone, but the history shows nothing Is there any
    • Email rejected per DMARC policy

      Hi, We've got the return message from zoho like 'host mx.zoho.com[204.141.33.44] said: 550 5.7.1 Email rejected per DMARC policy for circlecloudco.com in reply to end of DATA command' We're sure our source IP address matches the SPF the sender domain
    • EMail Migration to Google Apps is Too Slow

      We are moving to Google Apps and the email migration is really slow. Anyway you guys check if this is a server issue?
    • How to import subform data - SOLUTION

      To all trying to import subform data, I might have a solution for you. First of all, for this solution to work, the subform data needs to be an independent form (not ad hoc created on the main form). Furthermore, this approach uses Excel sheets - it might not work using CSV/TSV. If this is true, then follow these steps: Import the subform records Then export these records once more including their ID Now prepare an import file for the main form that needs to contain the subform records Within this
    • Help center custom tab - link color

      I’m trying to add a custom tab to the main navigation in the Zoho Desk Help Center, for example to link to an external resource like a website. The problem is that any custom tab I add always shows up as a blue link – it doesn’t match the style of the
    • Organization API: code 403 "Crm_Implied_Api_Access" error for "https://www.zohoapis.com/crm/v2/org"

      Hello. I've developed an add-on that allows clients to synchronize data from Zoho CRM with the Google Spreadsheet. I am using the OAUTH2 protocol, so clients will have to authenticate into their Zoho account, and Zoho will send back to the app an access token which will be used to get data. Currently, there are about 100 clients, and everything works smoothly. Today I've found that a guy who could become a new client was not able to to get his organization data, because the application receiving
    • Pick list - Cannot save list "Special Characters not Allowed" error message

      Bulk uploading values. All values are pretty standard - with the exception of a "-" (dash). Like:  Industry - Prepared Food Is the simple dash a special character too? Jan
    • Zoho Projects API Error - API v3; Always HTTP 400

      Below I have uploaded my .py file I'm using: Always returns with response 400 :(( Console Logs: (venv) PS C:\Users\sreep\venv> python .\TimesheetBuddy.py Token file not found. * Serving Flask app 'TimesheetBuddy' * Debug mode: off WARNING: This is a development
    • Inquiry: Integrating In-house Chatbot with Zoho Desk for Live Agent Support

      Hi Team, We are exploring the possibility of integrating our existing in-house chatbot with Zoho Desk to provide seamless escalation to live agents. Our requirement is as follows: within our chatbot interface, we want to offer users a "Talk to Agent"
    • Zoho Mail will not set up in Thunderbird

      I am using Thunderbird 13.0.1 in Linux Mint 13 64-bit.  I cannot set up my Zoho IMAP email in this client.  This is evidently a common problem as evidenced by these postings in the Thunderbird forum: thunderbird can't seem to "find the settings" I cannot configure it for my zoho.com email account I can not get ZOHO to configure. Any suggestions? The best T-bird seems to be able to do is to refer these users to the Zoho forum. I believe the instructions in the Zoho help wiki are correct, although
    • Introducing an option to set comments to public by default

      Hello all, Greetings! We are pleased to announce that Desk's user preferences now brings an option to set a comment type as Public or Private by default. In addition to setting reply buttons as defaults, Agents or Admins can now choose to make their ticket
    • Increase size of description editor when creating new ticket

      Please can you consider making the description editor in the create new ticket form a resizeable area as by default, it is very small and there appears to be no way to increase the size of it.
    • Flutter Plugin Compatibility Issue: Unresolved Reference to FlutterPluginRegistry in zohodesk_portal_apikit

      I am integrating the zohodesk_portal_apikit Flutter plugin (version 2.2.1) into my Flutter project, but I am encountering a build error related to an unresolved reference to FlutterPluginRegistry in the file ZDPBaseActivityAwarePlugin.kt. Below is the
    • I need my MFA number. I am trying to log into my CharmEhr. account and I can't get in. Everytime I try to sign in, it says to enter my MFA #. I don't have it.

      Need an MFA #
    • CRM Plus Accounts and Products relationships

      Is there a way that an invoice that is paid, would add the products to the account record once it is delivered? I want to find an easy way that products will get added to the account record and assumed this would work. The benefit here would be that I
    • "Super Admin Login as Another User" for Zoho One

      Dear Zoho One Team, We would like to request that the "Super Admin Login as Another User" feature be extended to Zoho One, allowing Super Admins to access user accounts across all Zoho One applications. We understand that this functionality is currently
    • Workflow for Creator App

      I am new to coding but doing pretty good with internet searching and ChatGPT but I have hit a major roadblock. What I am trying to do is have a sub-form populated with data from a form based on selected variables. I know this is possible because a guy
    • Subform dynamic fields on Edit, Load of Main form.

      Main Form: Time_Entry Sub Form (separate form): Time_Entries Time_Entries.Time_Entry_No is lookup to - Time_Entry.Time_Sheet_ID (auto number). I would like to disable some of the subform fields upon load (when edited) of the Time_Entry main form. What
    • Find all forms/fields containing a lookup field related to a specific form

      Hi, I'm trying to find all forms and the specific lookup fields they contain that are related to my Contacts form. I need to be able to do this programmatically (I know how to find this information using the schema builder). I've pulled the metadata for
    • Introducing the Eventbrite extension for Zoho CRM

      Hello Zoho CRM community, Are you struggling to keep your event registrations and attendance data organized across multiple platforms? Managing this information manually can be a frustrating and time-consuming task, and mistakes can easily occur, making
    • Deactivate Zoho CRM for everyone

      We would like to deactivate Zoho CRM for everyone. How can we do that?
    • 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.
    • Next Page