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

    • Transform Numeric Values using st, nd, rd, th or Convert Numerals to Ordinal Form - Deluge

      Please Use this sample Code This_Day_Date = zoho.currentdate.toString("dd"); value1 = "th"; if(This_Day_Date.right(1) ="1" && This_Day_Date != "11") { This_Day_Date = This_Day_Date+" "+"st"; } else if ( This_Day_Date.right(1) = "2" && This_Day_Date !=
    • How to drag and drop documents from Workdrive to Outlook

      Does anyone have an idea on how to drag and drop a document stored in workdrive into an email as an attachment in outlook? Similar to how it is possible to drag and drop documents from File Explorer stored documents straight into outlook as a static attachment.
    • Enhance Delay Configuration in Zoho Flow

      Dear Zoho Flow Support Team, We are writing to request an improvement to the delay configuration process within Zoho Flow. Currently, users are required to manually enter the exact delay duration (e.g., "2 days") in the delay block. This can be time-consuming
    • incoming email not blocked

      I am continually having to add emails and domains to my blocked list, but Still get an occasional email that is on the lists but does not get blocked. Suggestions?
    • Showing Amount Achieved Towards Target on Zoho CRM Dashboard

      I thought I'd create this post to stick a flag in the ground. My requirement: To create a visual gauge/bar chart in my CRM Sales Team Dashboard so salespeople can see their progress towards their monthly/quarterly/annual targets. The problem: After several
    • Reports for "current user"

      <Note: Topic relocated from "Start a discussion" to "Ask a question". Former post deleted.> Is it possible to specify an advanced filter for "whoever is logged in", instead of having to pick a specific user? I want to create one report the can be used by all members, but will only show data that belongs to the person logged in. When setting up the report, I want to use an advanced filter that is something like "Lead owner" "is" "${CURRENTUSER}". So the generated report will be specific to the member
    • Global Subforms

      Hey 👋🏼 We have a few subforms to calculate detailed offers for customers of car dealerships. These subforms are used in different modules and we need to create snapshots of them in different cases for documentation reasons. For example, an approved
    • Add Subform Field based on Record Field

      Hi All, I am struggling with finding a solution that can populate a subform field based on an existing field on the record. Use case is I have added Current Exchange Rate on a quote as a custom field, I then have a subform with Quoted items that include
    • Where are scheduled emails stored?

      After you schedule an email to go out through the CRM, how do you go about changing that scheduled email? Or even where can I see the list of emails scheduled to go out? They are not listed in my Zoho Mail account in Outbox which has been the only answer
    • Sheets are unbearably slow

      I'm doing some extremely simple sheets. Like 2 sheets each with 200 lines and 10 columns and a simple vlookup. ABSOLUTLY can not wait 20 secs to flip between sheets. What's up? anyone else having this trouble? Been this way for about 4 days now. Both
    • Rich text support for Notes

      Hi! Is there an opportunity to add Rich text field to Zoho CRM? We need a field that can save the HTML-formatted text in it. It's crucial for our business. Moderation Updates: The votes for supporting Rich Text for multi-line fields is captured in the
    • Colour Coded Flags in Tasks Module List View

      I really like the colour coded flags indicating the status of the tasks assigned to a Contact/Deal in the module list view. It would be a great addition to have this feature available in the list view of activities/tasks. I understand you have the Due
    • Notes formatting

      I see that I can format this idea proposal with bold, underlines , colors, and dot points even multi-level dot points However, I cannot do the same for notes in leads, contacts, potentials, etc. in CRM. This makes notes very difficult to read. PLEASE
    • Linking records from different modules

      Hello, Is there a way to link customer call records from the 'Calls' module to specific account and contact records? I've realized that our customer meeting reports are linked to both the contact and the Account records, in related list fields but the
    • Quickly send emails and sync conversations with custom email addresses in CRM

      Editions: All editions DCs: All DCs Release plan: This enhancement has been released for customers in all DCs except IN and US. We will be enabling it for IN and US DC customers soon. [Update on 22 May 2024] This enhancement has been released for all
    • Business_hour (by minute)

      Hi Zoho Team business_hours formula can only give the difference of time or day between two dates. (In the time calculation, it can only calculate the exact time. For example, it can give the difference between 16:30 and 16:55 as 0.) I want to calculate
    • At transaction level Discounts for Zoho books UAE version

      Dear Team, Please add transaction level Discounts for Zoho books UAE version. I have been requesting Zoho team past 3 years, Transaction level Discounts is a mandatory option required for our business needs. Zoho books Indian version has the option then
    • Where do Review Questions appear on the Performance Assessment?

      Hi, I want to create a Performance Assessment including only compentencies with a multiple-choice format, and a final open-text question after the competencies asking for justification of the previous objective questions. Can Review questions work for
    • Exit details not linked on employee profile

      Dear Team, The exit details that were filled in are not appearing in the employee's profile, and it seems the data is missing entirely. Please advise on how to proceed. Regards, Preetika
    • Client Script: Any plans to add support for multi-select field with onChange

      Client Script is fantastic and the documentation lists multiselect form fields as unsupported. Just wondering if there are any plans to make this a supported field. https://www.zoho.com/crm/developer/docs/client-script/client-script-events.html 2. Field
    • Versioning of Quotes and Invoices

      Would be nice if Zoho Invoice would offer the feature of saving all versions of a quote or invoice during the process - so if quotes or invoices get changed over time - a version of the old ones exist and can be reviewed and reactivated if necessary ... ;)
    • Banking - User Roles - Access To Single Bank Account

      Hi, We have different locations with each location having a specific bank account for Expenses/Etc... Can you please confirm on whether it's possible to give a user (non accountant), specific access to only a single bank account as opposed to all accounts
    • Does Zoho US Payroll now support employees in multiple states?

      Does Zoho US now support having employees in multiple US states? I looked at the site and can't find and of the restrictions on multiple states anywhere.
    • Help! Unable to send message

      Help! Unable to send message I have this email sales<at>teadvancehydraulics<dot>com, but I couldn't send outgoing email. (Reason:554 5.1.8 Email Outgoing Blocked.) Can you please help?
    • CRM Mail merge issues

      How do you configure the page on mail merge, from ZCRM??. I have written a template and structured the filters. the print preview is on one page.  I merge the document.  The merge reformats and then the document formatting moves higher and higher until by page 5 you have two half letters!!!  Very frustrating. Does anyone know if I need to insert a page break or how to correct /format this so it doesn't happen?? Help.  L
    • New notecards not syncing across devices

      Hello. I just noticed this problem happen recently. A new note being created on one device is not appearing on a different device, even though they're supposed to be synced with each other through setting it up on your account. I don't know if there's
    • Power of Automation :: Auto update a custom field based on Parallel transition under Blueprint

      Hello Everyone, A custom function is a software code that can be used to automate a process and this allows you to automate a notification, call a webhook, or perform logic immediately after a workflow rule is triggered. This feature helps to automate
    • Push error with Zoho Books and Zoho CRM

      I have successfully linked Books and CRM but I have some push errors with the following message: "The customer associated to this record is not linked to module chosen in the current contact sync configuration." I am unable to work this out, could you help please.
    • Sales Tax Rates

      Why is the Tax Customization feature limited to 2 decimal points? This issue has been mentioned several times over the last few years but it has not been changed. From a programming stand point, this should be relatively easy. Third decimal point capabilities
    • Feature Request: Ability to copy notecards to Windows desktop

      Hello, Please consider adding the ability to copy notecards to Windows desktop. Thanks!
    • Add RSS Feed Feature to Zoho Desk Communities and Knowledge Base

      It would be very useful to be able to get updates on content which is relevant to me from Zoho Desk Communities through RSS and also push my own Zoho Desk Community content to other platforms through RSS.
    • Do Individual Forums within Categories, in Desk Community, Produce Their Own RSS Feed?

      Do Individual Forums within Categories, in Desk Community, Produce Their Own RSS Feed? If not, can anyone share a work-around that could help me get an RSS feed for individual category forums?
    • Add customer to account based on domain name.

      I generate reports based on a the account field, i.e. companyX. In GoToAssist, my last provider, there was an option to automatically assign new ticket creators to a company (or account) based on their domain name. So for example, if a new employee creates
    • Zoho One Apps is not populating once clicked

      Hi Support, The Apps Menu button (corner right next to my profile) is not loading. It keeps flashing but nothing is showing up. When I type quick in the search bar to locate quickbooks, it continues to flash with no apps shown. Thanks
    • Tablet Pencil + Fillable Form

      Hi There, I just started using Zoho Writer Forms for our team on iOS. I noticed that some functions support 'scribble' or tablet pens and some do not. Is there a function I am missing where any text field can support 'scribble' or handwriting/printing
    • CRM API v2 AdWords GCLID Parameter

      Hi, I'm using AdWords Integration with Zoho CRM using a third party webform and can't manage to insert the "gclid" parameter via Zoho CRM API Leads endpoint (version 2). I already checked the following articles: 1. https://www.zoho.com/crm/help/google-adwords/configure.html#Third_Party 2. https://www.zoho.com/crm/help/api-diff/ Form submission works fine. On server side the gclid is correctly included in API request. The Lead is created successfully. All fields (system and custom) are populated correctly
    • Zoho Writer can be slow to load sometimes

      Hello! I've noticed that whenever I restart my web browser (Firefox 2) and try to open Zoho Writer, it always shows the login screen first, even if I have an URL direct to the writing interface itself. I don't recall it doing this in an older version, so why does it happen now? Also, sometimes when starting Zoho Writer, it gets stuck: I see the word "Loading..." come up and the page half-extends but never fully loads. I have to refresh the page totally in order to get it to work properly, but doing
    • 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
    • Next Page