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 a URL to a note

      I enter a lot of notes onto Account and Contact records. For example, I would like to add a note to a person with a link to their blog. When I paste the link into the note, it pastes ok, but it's not a "clickable" link. Is there a way to maintain the
    • Zoho webinar iOS app update: Introducing a dark theme, organizer's chat, emoji reactions, recording consent, and live answer on questions list.

      Hello everyone! In the latest version(v1.1) of the Zoho Webinar app, we have brought in support for the following features: Dark theme. Organizer's chat. Emoji reactions. Recording consent prompt for attendees. Live answer on questions list. 1. Dark theme:
    • Unveiling the next iteration of Ask Zia in Zoho CRM: An all-new chat interface, conversation history, actions, and much more

      Your CRM assistant just leveled up. Zoho CRM's Ask Zia functionality now offers a more conversational and context-aware experience to help you not just understand your data, but act on it—all from one chat window. With its redesigned interface and expanded
    • Field of Lookup in CRM

      Last modified on 04/04/2023: Field of lookup is now available for all Zoho CRM users in all DCs. Note that it was an early access feature available only upon request. Hello All, We're thrilled to talk about a much-awaited enhancement to lookup fields—now
    • [Free webinar series] Get to know Deluge: Zoho’s powerful scripting language

      Hello Everyone, We are much elated to invite you all to our upcoming session in Zoho Deluge! Bringing on to your table - Get to know Deluge: Zoho’s powerful scripting language Understanding Deluge Zoho’s suite of applications offers robust solutions for
    • Integrate with WooCommerce using Wordpress Plugin

      We’re thrilled to announce a powerful update to the Zoho Marketing Automation WordPress plugin with WooCommerce integration! This enhancement enables new possibilities for businesses running online stores using WooCommerce, empowering them to merge seamless
    • Can't find field from ZCRM for a trigger

      Hello, Currently I am revamping our CRM system and we have created second layouts from to try out new processes while not disrupting the old one. Moreover, we want to use different layouts for different processes. The issue is that when creating the ZCRM
    • How do I add an all ready created module, to an page

      So I have created a list of equipment in a module and want to add it to some of the customer accounts, but not all of them, how do I do this? Thanks :)
    • Integrate Zoho CRM and Zoho Workdrive

      I am having some trouble with my workdrive connection in zoho crm. What I want to do is this: 1) Create a folder for each account record in workdrive team folder, name it after the account name field 2) For each upload to a record in the deals module,
    • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(5/28)

      ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 5月開催のZoho ワークアウトについてお知らせします。 今回はZoomにてオンライン開催します。 ▷▷登録はこちら:https://us02web.zoom.us/meeting/register/l6xddhOoR--8rroMIgKWyA ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho
    • Zoho people - holidays apear on zoho calender?

      holidays that are stored within zoho people holidays can they be subscribed to within zoho calender?
    • Contact and Deal details in Company Module

      Hello, We would like to set up Zoho CRM based on Account/Company centric approach. We are using several Templates for each company in the Group. And the Account/Company module shall be available to all Templates. The Account/Company module will have all
    • Anone know how to add email body text in Button Properties ?

      When adding a button there is an option use a "Link to Email Address" which triggers an email addresses to the To: email and with the Subject as per the Subject field. I want to add some text in the body of the email, such as My contact details are: Name:
    • remove email address from an old account

      I have deleted the domain and/or closed the organization in my Zoho account, but the email address (e.g., info@brassprime.com , orders@brassprime.com , returns@Business Companion ) is still associated with the previous organization. Now I cannot
    • Multi-language Support Expanded!

      We are delighted to share some exciting news following our previous announcement about multi-language support! Our multi-language capabilities have been significantly enhanced to better serve our growing and diverse user base. Below is the complete list
    • Dynamic Dashboard for CRM Flyout/Widget

      Hello, Apologies if this has been answered before—it's possible I'm just not searching the community with the right terms. I'm trying to create a dashboard in Zoho Analytics that pulls together reports from several datasets (e.g., CRM Deals, Books Invoices,
    • LinkedIn Inbox Auto-Responder

      How do I set up an auto-responder message from my LinkedIn's company inbox?
    • Zoho Projects for Departments

      We’re currently using Zoho Projects across multiple departments in our company (e.g., Marketing and Project Implementation), and we’re trying to figure out the best way to keep each department's projects and templates completely separate. Here’s what
    • Getting daily summary report from SalesIQ

      Why am I suddenly getting a daily summary report from SalesIQ when I'm not even using it nor signed up to it knowingly?
    • Changes in the new UI of the record details page

      Hello everyone,   We released a new UI for the record details page early last month (March 11th, 2020) and are happy with the overwhelming response. A big thanks to everyone for your valuable feedback and suggestions.   Based on those suggestions, we have introduced the following changes: The width of the Notes section has been increased. The width of the Description column in the Related List has been increased. Introduced appropriate colors to represent the closed won or closed lost deals. The
    • Approval Process not triggering for specific user

      Hi there! I have a simple approval process set up and have confirmed that it is working for at least one of my team (I'm super admin). So, the process is set up correctly. However, for a specific user in my organization, the process doesn't trigger when
    • Turn Ticket into Zoho CRM Lead

      Is there a way to set up Zoho Desk -> Zoho CRM integration in a way that would allow out support agents to turn a Help Desk ticket into Zoho CRM Lead?
    • Import a list of contacts from csv and delete them

      I have a list of email addresses which I want to delete from all lists. The contacts are distributed over multiple lists. So I cannot delete whole lists because there are other contacts too? Is there a way to import the list and delete the contacts in
    • AUTO ASIGNACION DE TICKETS

      Cuando uno se asigna un ticket y lo contesta se queda asignada esa persona automaticamente para cuando se tenga respuesta de ese ticket, ¿como puedo configurar que ningun ticket se auto asigne? que todo sea manual
    • Custom Time Range Support for Zia Trending Auto Tags in Zoho Desk

      Dear Zoho Desk Team, We’d like to formally request an enhancement to the Zia’s trending auto tags feature to better support our business needs. 🧩 Use Case: We actively rely on Zia auto-tags to: Monitor recurring customer issues. Detect emerging trends.
    • Enhanced Tag Filtering and Selection in Zoho Desk Custom Views

      Dear Zoho Desk Team, We’d like to request enhancements to the tag filtering and selection capabilities when creating custom views in Zoho Desk. 📝 Current Limitation: While it is currently possible to create a custom view using tags and status as criteria,
    • Creator help with max value

      Hi! I come from MS access and I want to build in creator. I have a Registration App I want to make. The main table is called Registrations and I have a subform called RegProgress where the user can indicate the progress by selecting one of 6 steps. Those
    • Can't call function with ZML Button

      Hi, I have a page where I have a subform and a button made in ZML. My initial goal is simply that onClick, I call a function that updates multiple entries. Even though the function exist, I am unable to reference it. If I try to reference it manually
    • How do i move multiple tickets to a different department?

      Hello, i have several tickets that have been assigned to the wrong department.  I am talking about hundreds of automatically generated ones that come from a separate system. How can i select them all at once to move them to another department in one go? I can select them in "unsassigned open tickets view" but i can't find a "move to another department" option. I also can't seem to assign multiple tickets to the same agent in that same view. Could somebody advice?
    • Creating credit cards with sub-accounts for employee cards?

      I'm trying to figure out how to go about reconciling our credit card accounts in Zoho Books since each credit card pulls into its own account, rather than employee cards pulling into a sub-account of the primary card. Ideally, I'd like to be able to setup
    • ZUG is Hitting the Road — Across the USA!

      We’re bringing the Zoho User Group (ZUG) meet-ups back to various cities across the United States — and we’re more excited than ever to reconnect with our incredible community! Whether you're a seasoned Zoho user or just getting started, this event is
    • Ask the Experts 20: Level up your customer service with Zia

      Hello everyone! We're excited to reconnect with you again. The recent sessions of our Ask the Experts series have contributed to valuable conversations, beginning at the live sessions and evolving into one-on-one conversations and remote-sessions where
    • Custom Canvas Tabs

      Hi Team Can you advise if there is a particular tab layout I need to be using in Canvas in order to have the numbers show on the tab ie for a new note it would show 1 as like with the standard view? The below is what I have: This is the desired outc
    • In focus: Profile permissions in Radar

      Hello everyone, Imagine a help desk where everyone can access everything without restrictions. Newbies could answer tickets without supervision, agents would meddle with system settings, and contract employees would have unrestricted access to business
    • Deluge Script wishlist...

      Just throwing it out there ;) 1. += operator. Pleeeeease no more var = var + "test"; 2. Ternary Operator for if/else. Man I wish I could just go myVar = myVar == "test" ? "it is test" : "it's not test" instead of having to write out a huge if/else block of ugly brackets.  3. square bracket notation for referring to record fields and map views.  This would make it terribly hard for Zoho to debug which might break the whole goal of saving new users from themselves. But here's why it would be extremely
    • Selling a product consisting of several components

      hi all,  I have a small issue with inventory items, I am a perfume company, and my product consists of many items,  how can I manage this, from purchase the items and convert them to be one item ready for sales  - using ZOHO platform ..
    • How to Move Behavior, Acquisition, Polls & Forms Data from Zoho PageSense to Zoho Analytics?

      Hi Zoho Community, I'm looking for a way to transfer data from Zoho PageSense to Zoho Analytics, specifically: Behavioral data (clicks, scrolls, heatmaps, etc.) Acquisition data (traffic sources, campaigns, etc.) Polls and forms data As far as I can tell:
    • [Zoho Flow] Problem using "Send document for signing"

      Hi, I get the error "Zoho Writer says \"An Internal Server Error occurred while processing this request.\"" cant understand what exactly the problem is. Any ideas? Thank you KR, Victoria
    • Fusion d'un champ image avec Writer ou Template CRM

      Il semble impossible pour le moment de fusionner dans le CRM un champ de type image vers un template. Par exemple : fusionner une image située dans le champ devis du CRM vers le template 'inventaire-devis'. Impossible également de réaliser cette opération
    • Gestion de suivi des expéditions

      Le suivi des expéditions est un élément indispensable à une gestion réussie de la chaîne d'approvisionnement. Aussi bien le fournisseur que le client peuvent bénéficier de la transparence et de la responsabilité apportées par le système ; ce dernier fournit
    • Next Page