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

    • Unable to create a download link for an uploaded Workdrive File

      Hello, I have some custom logic that is working fine to load image files into a Workdrive folder. I'm not having much success however in being able to then set the file as downloadable and retrieving the download link from my custom logic. My code for
    • Data preservation when a Recruiter Admin leaves the organisation and account is deleted

      I can’t find in the documentation on this topic, so asking here. When the Recruiter Admin employee who has done all the hiring work, e.g. publish job postings, updating email notification templates, changing candidate statuses, writing notes, communicating
    • Zoho Sprints mobile app(Android and iOS) v2.0

      Hello everyone! We’re thrilled to announce that Zoho Sprints Mobile app2.0 is now live. With the newest version of the Zoho Sprints mobile app, we hope to provide a fresh, faster, and intuitive experience for managing your sprints on the go! Whether you're
    • Open-source Zoho API package for Python

      Dear Community, Some time ago I have started working on Zoho API to handle data management in more automated manner than before. Then I have found no relevant materials, except of Zoho API documentation, about how to start. Of course I do not mean it
    • Zoho Writer and Zoho Forms - Merge on update of a form

      Once Zoho Form is submitted it requires a check by the adviser / sales person and adding additional infomation to it before it gets send to the customer for the signature. Unfortuantely there is no option to Merge on update, only on submission of the
    • Journal Entries Do Not Show Multiple Entries to the Same Account

      Another basic accounting function that Books ... Accountants sometimes write journal entries, debiting and/or crediting the same account in the same entry. This is due to the need to record specific activity in an account when we pull reports especially
    • Cookies

      Hey Guys, being a EU based company, we're forced to show the cookie banner, providing easy to read information about the cookies we use and giving the choice to select which cookies the accept. I know in Zoho Marketing Hub, SalesIQ and Sites there are
    • Zoho Sign Custom Domain

      Any plans for Custom Domain?
    • Introducing AI-powered agreement management in Zoho Sign

      Hello! From automating repetitive tasks to enabling smarter decision-making, AI has moved from a futuristic concept to a practical tool for modern businesses. One of the most impactful applications of AI is in agreement and contract management. By leveraging
    • My bank is not in Books

      Hello, I tried to configure bank feeds for my bank, but it doesn't appear in the list of supported banks. Does that mean that i cannot configure feeds at all ? Is there any way to add my bank in the list ? Also, as far as I saw, the list has no Belgian bank : Belfius, BNP Paribas Fortis, KBC,... Thanks for you answer Xavier Liégeois Though Happy Zoho user
    • Updating a contact record's multiple select field

      Hi folks, I have a multiple select field (called Mailing Lists) in Zoho CRM which I wish to set to the text "Weekly Email" I have created a step in Zoho Flow using a Create or Update Contact. In the Mailing Lists field, I put the text "Weekly Email"  (including the quotes) but the flow returns an error requesting a jsondatatype.  I have tried {'Weekly Email'} but I still get the same error. Also tried Weekly Email (without the quotes) How do I format an update of a multiple select field  with Zoho
    • CRM module name capitalisation bug ?

      HI, I''m writing a deluge script from Desk to create a task in CRM. All is good when I deal with a lead, but not when a contact is involved. It took me days to figure it out. It might be a bug. Here is a snippet of my script // Ticket Description taskMap.put("What_Id",{"id":ticketContactId});
    • Can I convert Multiline fields from Plain text to Rich Text?

      I have added several custom multiline fields (Plain text) in the Zoho CRM module "Accounts" before the Rich Text (RTF) feature was released in 2024. Now I am looking for a way to convert them to Rich Text format. Is there a way to do this? The problem
    • Webinar Recording: Maximizing Productivity with Bigin's Mobile Apps

      Dear Biginners, Hope you're doing well! As part of our ongoing Masterclass series, we’ve just completed an exciting webinar that explores the capabilities of our mobile apps. Whether it’s managing deals, communicating with customers, or meeting deadlines,
    • Need Help with Zoho CRM Integration

      Hello everyone! 👋 I'm currently in the process of integrating Zoho CRM with an Android gaming website focused on Fire Kirin Game. While everything is progressing smoothly, I'd love to get some expert input to make the integration as efficient and seamless
    • Validating an order by a superior

      Hi, I have a very specific use case for Backstage. Let me know if this is possible or how I could get around this (or if there are no workaround). One of my client uses Backstage to manage internal (on site) events. Participants from different departments
    • Lets Talk Recruit: Key Takeaways from Our India Community Meetups

      Welcome back to Let’s Talk Recruit, the series where we bring you real stories, product insights, and community highlights from the world of recruitment. Our last post covered how you can build approval processes with zero follow-ups using Recruit. In
    • Emails Migration to Zoho

      Hi, I am in the middle of a migration from Salesforce to Zoho one. I am stuck on migratiing emails from Salesforce into Zoho. Does anyone have any suggestions?
    • How to set an automatic BCC recipient

      Hi there, is it possible to set a BCC recipient email address that is automatically showing up in the BCC field when you compile an email for a contact or lead? I want pretty much all emails I sent out of Zoho CRM to have the same BCC email recipient,
    • zoho commerce

      "I need to know where to find the wishlist function in Zoho Commerce."
    • Request to Recover Deleted Task List – Project ID: RIV-MOD-10722

      Hi Zoho Team, I hope this message finds you well. My Zoho task list associated with Project ID: RIV-MOD-10722 appears to have been deleted. When I clicked on the task link from the email notification, I received the following message: "Task has been deleted
    • Error 400 Booking

      Added a custom domain to Booking. Am Getting a SSL Error that has some other domain on the SSL and giving a 400 error. Followed instructions and it stated it verified our domain.. However it is not working. Please Help!
    • Popup Input Fields on Kanban View

      Hi, I have modified the default deals module in zoho crm and using it with kanban view , I've configured my blueprint to ask for necessary input fields on stage updates but it only works on the deal details page. What I want to achieve is to show these
    • Zoho Developer Hangout (ZDH) – Episode 19 | Catalyst for Zoho Developers

      Hey developers! Ready to shift gears from writing long Deluge scripts to building with single-purpose functions and powerful service calls? This session is for Zoho developers who are familiar with typical approaches to working in the Deluge environment
    • Why is it so difficult to login to zoho store dashboard

      I have logged in using zoho id and unable to access dashboard from past 30 mins - why is it so difficult to go dashboard of my own store?
    • Problem with CRM Connection not Refreshing Token

      I've setup a connection with Zoom in the CRM. I'm using this connection to automate some registrations, so my team doesn't have to manually create them in both the CRM and Zoom. Connection works great in my function until the token expires. It does not refresh and I have to manually revoke the connection and connect it again. I've chatted with Zoho about this and after emailing me that it couldn't be done I asked for specifics on why and they responded. "The connection is CRM is not a feature to
    • Zoho Thrive is getting a revamp: Here’s what’s changing

      We’re excited to bring you an upgraded Zoho Thrive experience! This update features a more intuitive interface, improved navigation, and enhancements to help you manage your affiliate and loyalty programs with ease. What’s new? A more flexible start:
    • Narrow Columns for the Calendar Day View

      Hello Zoho folks, First off thank you for Zoho Bookings! I have a feature request: the ability to adjust the columns width for the calendar Day View. User Story: Given that I am a Zoho Bookings admin And I am logged-in And I have > 5 staff members When
    • Using Bookings as a training management system

      I'm looking for a system for my company. We need to be able to give clients a way of booking courses with us from a pre-defined schedule. We'll need for them to be able to book, cancel or amend bookings without manual intervention from our side. The system
    • Multi Vendor store

      Are there any options for setting up an online mall or marketplace that supports multiple vendors, like Etsy and Amazon, where a buyer can search across multiple stores within a mall to find products? Each store owner can administer their own products
    • Related List Client Script

      Noticed that now we support Related List Client Script. But I cannot find any guidance regarding this. May I know how to capture the chosen value?
    • Importing into Multiselect Picklist

      Hi, We just completed a trade show and one of the bits of information we collect is tool style. The application supplied by the show set this up as individual questions. For example, if the customer used Thick Turret and Trumpf style but not Thin Turret,
    • Limited to one Image Attachment in Service Reports

      The ability to attach multiple before and after pictures of work performed is a vital feature for many field service companies. Current attachment limit is 10MB. When adding an image to the appointment notes field, it is producing an image with an average
    • Zoho Forms Layout Limitations Impacting Conversion

      Hi everyone, I’m encountering some challenges with Zoho Forms' design and layout limitations, and I believe this is impacting the conversion rate of our website. Our goal is to capture as much information as possible from leads, but for UI/UX reasons,
    • How to add two columns in Zoho forms

      I would like to have two columns in Zoho forms. How can i enable two columns?
    • Cancelled appointments still block out timeslot

      I haven't had to test this before, but I've just found a problem. I had an appointment in a certain timeslot, and that appointment was cancelled. However, Bookings won't let another appointment be booked in that slot - it makes that time unavailable until
    • Zoho Bookings <> Oulook

      When a user has their Outlook connected to Bookings should it be able to recognise existing meetings and not give those as available options ? If so, how long is the sync time : ie If i were to put a private meeting at 3pm in my Outlook, how long would
    • where i can see estimated revenue

    • Don't allow scheduling service on same day

      Is there a way when setting up a Service for people to schedule to not allow them to schedule it for the same day, only a future date? We don't want people scheduling their meeting/service without giving us time to prepare for it.
    • ZOHO BOOKINGS, Add Contact settings

      How can I edit the add contact form, to change to not mandatory fields email or phone number? thanks
    • Next Page