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

    • 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
    • Zoho Please change your ways

      I started using Your new Zoho bookings in earnest 3 days ago. What a mistake.  Once again, everything is backwards and upside down.  I had to spend 5 hours testing how the thing works in order for me to understand how to acutally use it.  When i started using google calendar years ago.  it took seconds to figure out how it works. Why is that. bc they put everything in places where it makes sense.  Today, I needed to add an appointment as well as a time off.  Stupid me i added the time off first,
    • ZOho Booking and CRM integration.

      We are using Zoho Booking wiht Zoho CRM in a custom module. Inside our module we use the option to book a meeting with the customer. This part works great we feed the field to the URL and everything work 100%. Now my issue is that I was not able to find
    • cannot link my email to Zoho CRM

      We are reviewing Zoho as we heard it was an easy solution platform, but we have been trying for many days to get anyone at Zoho to schedule call to talk with us. We unsuccessfully have tried multiple times to link email to Zoho. We put in request for
    • How do I delete a test email address to which I am supposed to send a test email?

      How do I delete an email address added to a test email recipient that is no longer needed due to resignation or other reasons?
    • Happiness Feedback Report

      Hello,  I want to see all the feedback, which has been left on ratings in a report for all past tickets. Unfortunately, the pre-built happiness dashboard only lets you go back one month. When I create a report, I cannot add the column 'feedback' and I
    • Interest on late payments

      Is this ever going to be implemented on Zoho Books?  It's particularly annoying as its been working so well on Zoho invoice for the last year or so.
    • Awful audio quality

      Hi guys I'm using Zoho Cliq (paid) with my team (remote team : France, Madagascar and Tunisia). Unfortunately, we encounter issues everytime on audio call (and more when we use screenshare) with sound quality, audio lag, etc. We spend loooot of time to
    • How do I see what participants see when I am app sharing in a meeting?

      How do I see what participants see when I am app sharing in a meeting? In my view, I only see myself as active, but not the app (keynote on mac)
    • Items: Custom lookup field with values from a custom module?

      Use case: I have created a new custom module called Makes to hold the names of thousands of different manufacturers. I am trying to create a custom lookup field for Items that uses the custom module. I am not able to select the custom module for the lookup
    • Canva Integration

      Hello! As many marketing departments are streamlining their teams, many have begun utilizing Canva for all design mockups and approvals prior to its integration into Marketing automation software. While Zoho Social has this integration already accomplished,
    • Clone Entire Zoho Boooks Organization, including all transactions for testing & training

      Can Zoho Books support help with direct cloning of entire Zoho Books & Inventory Organization? including all transactions, just like a copy & paste or disk cloning. Is this possible?
    • Can't change login email address in zoho books.

      Hello, Does anyone have any idea how to change login email in zoho books?
    • Zoho Site Vs. Wordpress website - which is better ?

      Hi I  have a Wordpress website  hosted at hostgator.   I use zoho CRM  for leads , customers, scheduling , etc.  I am considering moving my website to zoho sites.  What are advantages  and disadvantages to using zoho site compared to a wordpress website? On a scale of 1 to 10 ,  how good is zoho sites?    zoho sites with being found by potential customer searching the web for products , services? I sell and service business phone systems into local markets in California. My goal would be to increase
    • Bank Reconciliation Reports Do Not Have the Requisite Information Needed for a Proper Bank Rec Report

      Basic accounting practices for bank reconciliations dictate that bank reconciliation reports have the following components: Date or Period of Reconciliation: The report should clearly state the date for which the reconciliation is being performed, typically
    • How to record chargeback in zoho books?

      Hi all, Does anyone know how to record a chargeback transaction in zoho books? Thanks, Mo
    • workflow fields before assigning the ticket when the client opens the case by email.

      I want to create a workflow that forces the technician to complete the mandatory fields before assigning the ticket when the client opens the case by email.
    • Answer to wrong email address

      Hi Everybody! When we receive a customer request (let's call him Peter) on our info@abc.com mail address, we manually forward the email message to Zoho desk (support@). Of course, sender of that message is info@abc.com and Zoho opens a new ticket with "info" as the contact name and info@abc.com as email address (nobody can blame Zoho for doing that). We then edit the ticket and fill in contact name (Peter), account name (Peter Ltd) and email address (peter@mail.com) of the customer. When we answer
    • Zoho Desk nog sending true Gmail

      Desk isn't sending our outgoing e-mail anymore. We can still receive e-mails but not send. I reconnected the email again and disabled the 2FA (to test). If I choose the Desk generated outgoing email address it works just fine. Please assist.
    • Add Hebrew Language Support for Zia Auto-Tag in Zoho Desk

      Dear Zoho Desk Team, We hope this message finds you well. We are currently utilizing the Zia Auto-Tag feature in Zoho Desk, which has proven to be quite valuable for categorizing and organizing tickets based on their content. However, we’ve encountered
    • Footer: Zoho make a big downgrad with new footer option

      Every post about the new footer function is negative and all say: its a big downgrade. The idea behind this new function was: Make it more simple. Great, now its faster and more simple to add an footer. But nobody from zoho team think about the more bigger
    • Need help with Zoho Billing/Subscriptions API

      Hello, We need help in figuring out which APIs to use in the following scenarios to process customer payments and manage subscriptions. When 14 days trial period is over and subscription status in Zoho changes to "TRIAL_EXPIRED" , customer comes back
    • Multiple Filters? Question answered many times, but never satisfactorily

      Hi. I love Zoho Creator.   However, I would like to know more about creating a view that allows users to easily filter the records, using several filters at once.   I know many people have asked this before, and mostly the answer given is "Use the search function, and search in each column for the required parameter"   However, this is not a satisfactory solution for a number of reasons:   1) You have to know the exact value to search for (sometimes the value might be a two or three word answer)
    • Sendmail with filtered report as attachment - Best practice ?

      Salut, I am scripting sendmail workflows with reports attached. I need those reports to be filtered. For example, a 10 subrows order would have 3 different suppliers, and I want those 3 suppliers to receive a copy of the order with only the subrows related
    • Issues w/ Screen Share & Accessing via Mobile Web Browsers

      1. How do I share my screen while still seeing video of myself & paticipants without rebroadcasting the participant video feeds? All other video conferencing tools provide this feature so not sure if it's a setting I'm missing or a programming oversight. 2. How do I know what screen/application I'm sharing? After selecting the screen/application a notice appears however it is appears on the wrong screen leading to confusion about what participants can actually see.  3. How to I allow participants
    • Time Limited Coupon or Expiring Link in Workflows

      I would like to see a feature where I can include a time limited link in Workflow Campaigns. For example: I could link to a sales page with a discount and set the link to expire after 24h. The link would be generated by Campaigns for each campaign sent
    • Option to duplicate views ( ticket and others)

      Hello, I would like to ask for the option to duplicates views, especially ticket views. Often we need to use the views for very particular information, including filtering out custom data. It would be great to allow duplicate an existing View, so it can
    • Option to copy/duplicate Custom Ticket views

      Hi Team, Hope you're all well. I was wondering if you would consider a feature on Custom Ticket views: The option to copy or duplicate an existing custom ticket view It would help tremendously for views with a lot of criteria that could be reused multiple
    • Democratize data visualization across your organization using Chart View in CRM

      Hello everyone - As part of CRM for Everyone, we've introduced a whole new set of features. This announcement will focus on one of them: Chart View. Why did we add this view? To put insights directly in the hands of the people closest to the action. Here's
    • Will Zoho implement DANE?

      I know that setting up DNSSEC and DANE is quite a risky process. But it will improve email security. With DANE, a server can verify a SSL certificate before connecting to the server. There are some RFC related to DANE which can be found here: DNS-based
    • How do I stop Notifications in Mail?

      How does one turn off notifications for our Mail accounts? Why is an answer to such a basic question impossible to find in this community forum? Also, could you point us to the most current user guide so we don't have to spend time asking such fundamental
    • Turning off self view in Zoho Meeting

      Hi Is it possible to turn off/hide self view in meetings?  Cant see any options for it. Thanks
    • Is it possible to hide self view in Zoho Meetings

      Hi - I want to hide my camera view when conducting meetings in Zoho Meetings.  Most of my meetings are one to one with clients & I prefer to focus on them them on the screen? I've searched and cant find any options for this? Thanks Ro
    • Darshan Hiranandani : Can I hide my self-view in Zoho Meetings, and if so, how?

      Hi everyone, I’m Darshan Hiranandani, looking for a way to hide my self-view during meetings in Zoho Meetings. I find that seeing my own video feed can be distracting, and I’d like to know if there’s an option to hide or disable it. Could anyone provide
    • mx.zoho.com servers blacklisted by UCEPROTECTL3

      Hello, An MXtoolbox check for my domain showed that UCEPROTECTL3 has blacklisted all three of the zoho MX servers. I am unable to sign up for Zeptomail service for our company transactional emails until this issue is resolved. But this is out of my hands.
    • How to integrate Zoho CRM, Zoho Forms and a WIX Web Site

      Attached video demonstrates how to use Zoho Forms included in Zoho One, to design a Contact Us form to be embedded into a WIX web site and integrated into Zoho CRM.
    • Events on Calendar disappeared

      hello, Events (e.g. repeating events) disappeared on my calendar for Wed, Oct 2, which led to missing some meetings on that day. What exactly is wrong? This is not the first time this is happening! Please, fix this calendar issue.
    • FICHIER FEC - ZOHO BOOKS

      J'ai testé le fichier FEC, disponible depuis quelques semaines dans zoho books pour les sociétés françaises. C'est une grande avancée car nous allons enfin pouvoir importer facilement (sans avoir à réaliser de complexes rapports dans zoho analytics) la
    • Next Page