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

    • Mass email processes

      Hello, I'm looking to send about 7k emails out. I have them in CSV format with most being people I have previously communicated with. My questions are: * What is the process for using Zoho to send this group of emails out utilizing Microsoft 365 ? I'm
    • Zoho WorkDrive 5.0 : d’un outil vers une solution intelligente de gestion de documents

      Dans un monde de plus en plus orienté vers les données, les entreprises doivent non seulement gérer une masse croissante de données non structurées, mais aussi en extraire des informations stratégiques. L’intelligence de contenu répond à ce besoin en
    • Weekly Tips: Avoid any email mishaps using Zoho Mail's Email Recall

      Let's say you have just sent an important email to a recipient with an important attachment. Moments after hitting send, you realize the attachment is outdated and missing some critical updates. Sending another corrected version of the email without addressing
    • Messaging

      Whenever i send a mail to someone, it come with the my name of the company, instead of the name of my company.
    • Can't receive emails. MX Records are good apparently.

      Hello, For the past couple of days I have been able to send but unable to receive email through Zoho Webmail. I went into Admin Console and it says: MX Records are configured correctly and Your Domains MX Records are pointed to Zoho. Could you please
    • How can I customize my sales pipeline in Zoho.com CRM ?

      Hi to all intelligent community members I’m Namrata Hinduja Geneva, Switzerland, new member in Zoho.com and in this community. Please resolve my query - How can I customize my sales pipeline in Zoho.com CRM to track the progress of deals more effectively?
    • Error when adding phone number

      Hi Team, I'm getting an error when trying to authenticate using my phone, please see image attached. thanks, Jose
    • Zoho Projects iOS app update: Revamp of toast message and an option to view the whiteboard images

      Hello everyone! In the most recent Zoho Projects app update, we have brought in support for the following features: 1. Toast message revamp: We have enhanced the toast message banners to a bolder interface. You will now be updated on the progress of uploads
    • Send a new invoice data from Books to local certified solution via API json due local compliance

      Greetings, I hope you are doing well and staying safe. Due to local compliance regulations, I am required to issue invoices exclusively using locally certified software, which Zoho Books is not. However, we would like to continue using Zoho Books, so
    • How to Populate the Amount field of a Deal by subform's aggregate data

      https://help.zoho.com/portal/community/topic/custom-function-25-%c2%a0populate-the-amount-field-of-a-deal-by-calculating-the-number-of-related-products-and-its-unit-price I'm trying to do an Deal amount update like this guide but I use a subform to calculate the product amount and price instead. Please help me writing the code. regards
    • Unblocking Outgoing Emails on exports@carelyexport.com – Urgent Assistance Needed

      We are a newly established export-import startup operating under the business name Carely Export, and we are currently using Zoho Mail for our business communications. However, we are experiencing an issue where our outgoing emails are being blocked,
    • Property Management: Creating Amazing Appointment Scheduling Sites

      Sometimes a property management company can be very busy where even some time and effort saved can make a difference in a world. If you are a property manager, would you not like it if you could spend the wasted time managing appointments to get your job done? This is where getting a booking appointment platform lets you improve efficiency and save time. The enticing scheduling appointment platform can also help get more clients in than normal. It will help you contend with other companies that have
    • IP BLACKLISTED UCEPROTECTL3

      Your IP 136.143.188.56 was NOT directly involved in aabuse, but has a bad neighborhood. Other customers within this range did not care about their security and got hacked, started spamming, or were even attacking others, while your provider has possibly
    • Adding Public Holidays to the Calendar

      Hi, How do you add a public holiday to the calendar, we are closed on public holidays but if someone has requested holidays over that time how do we avoid the day being deducted as this is already a paid holiday? 
    • Your inbox called; it wants less clutter

      Inbox full of ghosts? Let Auto-Close do the haunting. Ever stared at your support inbox wondering why half the chats are just… sitting there? No reply, no closure, just hanging like unread messages from a advertising company. Let’s fix that. With Auto-Close,
    • an issue in Zoho CRM where the workflow rule is not triggering

      H I’m currently facing an issue in Zoho CRM where the workflow rule is not triggering when a new lead is created through a webform. I’ve double-checked the criteria and field updates, everything seems fine but it still doesn’t fire. Has anyone faced this
    • Feature Request: Mass update selected Contacts to Accounts

      I can't believe this isn't an ability already. It's a quick fix that would save hours of manual entry time. This looks like it had been requested 3-4 years ago with no answers from staff! Please add all contact fields into the "mass update" menu. You
    • How to add the other customer to the list of customers

      So I have a list of customers with the option of other. So when I select other and the new customer, how to get to it be saved to that list in creator.
    • Automate and Personalize Engagement for Campaign Leads Using Zoho SalesIQ Chatbots

      Hi everyone! In our last post, we explored how to identify, qualify, and nurture leads using SalesIQ Triggers and Zoho Campaigns integration. To recap, once visitors meet your criteria, you can add them to a Campaigns mailing list with Triggers. When
    • compensation module - salary - No decimals allowed regardless of currency

      In the United Kingdom we have calculations in GBP which has figures to 2 decimal points. When using either the basic salary or using the CTC with benefits etc. It will block any upload or entry which is not a round number! I have advised Zoho One and
    • Unable to add estimate field to estimate template

      I have the field "SKU" as part of my service data. I can also see it as a column when displaying the list of services. However, I have no way to include it on my estimate template because the field is not showing as a column field to include for the service/part
    • Adding Today's Date into an email template

      Is it possible to add today's date into an email template? Any help would be gratefully received.
    • Entry created or updated - not getting all fields

      I have a flow that fires on an entry being created or updated in a custom module in CRM.  It is only supposed to proceed if a particular field is false and once fired, immediately updates that field to true to avoid running multiple times.  For some reason,
    • Help createing Inventory Volume report

      I've been working with Zoho support for a few months now trying to develop a inventory volume report. Though they have been helpful, it never seems to generate exactly what we're looking for. I thought I'd turn to the community for further help. We've
    • Zoho Sprints - Timesheet Rejected

      Does a user get notified is his Timesheet entry has been rejected?
    • Sixth Insight - The Hidden C in Data

      The Wheels of Ticketing - Desk Stories The Hidden C in Data [Importance of clean data] Data cleaning Data cleaning ensures ticketing systems' data is accurate, consistent, and complete. This process includes eliminating duplicates, fixing errors, and
    • Simple Text Search Function

      Would it be too much to ask for a simple text search function? My slide decks are often simply collections of slides of a random over, and I often have to find the slide I need at a moment's notice. A text search function, no matter how rudimentary, would
    • KPI Widget would not load columns

      My Zoho Analytics would not load columns on KPI Widgets, is there anyone who could help me on this?
    • Introducing the calendar view for Bigin's Activities module

      Hello everyone, We're excited to announce the calendar view in Bigin. This view presents all tasks, events, and calls in an intuitive and visually appealing interface, and will be set as the Activities module's default landing page, ensuring you have
    • Its 2022, can our customers log into CRM on their mobiles? Zoho Response: Maybe Later

      I am a long time Zoho CRM user. I have just started using the client portal feature. On the plus side I have found it very fast and very easy (for someone used to the CRM config) to set up a subset of module views that make a potentially extremely useful
    • 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?
    • Next Page