Automation#31: Automate Splitting Names for New Contact Records

Automation#31: Automate Splitting Names for New Contact Records


Hello Everyone, 
This week, we present to you a custom function, which allows you to split the first and last names from the user's email ID based on the separator used in the ID.
Having grown into a large firm, Zylker Techfix aims to optimize its processes, data management, and organization. By default, contacts are created by extracting the customers' names from the email addresses and saving them in the "Last Name" field in the Customers' module. 


To create an organized directory, Zylker Techfix wanted to separate the first and last names from the email address using the (.) separator in the email ID. 
This custom function allowed them to achieve this with their contacts. Now, you can organize your contacts within Zoho Desk too.
Follow the steps below to configure the 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 Disable the toggle for User Credentials of Login User.
  1.6 Under Scope, choose the below scope values:
Desk.contacts.UPDATE
Desk.contacts.READ
  1.7 Click Create and Connect.
  1.8 Click Connect and click Accept.
Connection is created successfully.

Create a Workflow Rule
1. Go to Setup(S), choose Workflows under Automation
2. Under Workflows, click Create Rule.

In the Basic Information section,
3. Select Contacts from the drop-down menu under Module.
4. Enter a Rule Name and Description for the rule.
5. If you want to activate the rule right away, select the Active checkbox. Else, create the rule and activate it later.
6. Click Next.
 
In the Execute on section, follow these steps:
7. Select Create.   
8. Click Next.
 
9. In the Criteria section, add criteria if required. click Next.
 
10. In the Actions section, click the + icon and select New next to Custom Functions.
11. Under Basic Information, enter Name and Description for the custom function. Choose Contacts under Module.
12. 
Under Argument Mapping, give a desired Method Name. Map the arguments as below: 
       12.1 In the Argument Name field, type contactId and select Contact ID under the Contacts Section.                                
13. In the script window, insert the Custom Function given below:
  1. //------------- User Inputs ----------
  2. orgId = "60xxxxxxxx0"; //replace with your Org ID
  3. operator = "."; 
  4. //---------------------------------
  5. logs = Map();
  6. try {
  7. contacts = zoho.desk.getRecordById(orgId,"contacts",contactId, "deskcontact");
  8. firstName = contacts.get("firstName");
  9. lastName = contacts.get("lastName");
  10. if(lastName.contains(operator))
  11. {
  12.        if(operator.contains(".")){
  13.          lastName = lastName.subString(0,lastName.indexOf("@"));
  14.        }
  15.        firstName = lastName.subString(0,lastName.indexOf(operator)).trim();
  16.        lastName = lastName.subString(lastName.indexOf(operator) + 1);
  17.        updateContact = zoho.desk.update(orgId,"contacts",contactId,{"firstName":firstName,"lastName":lastName},"deskcontact");
  18.    }
  19. }
  20. catch (errorInfo)
  21. {
  22. logs.insert("errorInfo":errorInfo);
  23. }
  24. info "logs: \n" + logs;

  25. if(logs.containKey("errorInfo"))
  26. {
  27. throws "Error happen in the CF execution";
  28. }
NOTE
a. In Line 2, Enter your OrgId with  "  ".
To access OrgId, go to Setup (S) >> Developer Space >> APIs >> API Authentication.
14. Click Save to save the custom function.
15. Click Save again to save the workflow.
Context
Once configured, this function splits the first and last names for incoming new contacts. This custom function applies to new contacts and new incoming tickets.


We hope this custom function helps you manage your contacts efficiently. Share your feedback and connect with us for more tips and insights. 
See you next week!
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 'Log a Call' link to three dot icon in Canvas

        Hi, There's a three dot element when creating a canvas called 'More'. I would like to modify this to add a link that says 'Log a Call' in order to quickly record the details of a cellphone call. I'd also like this to be a simple 'contact' selection and
      • Syncing Zoho Forms with Bigin - Embedding issue?

        Hello everyone, I created a Zoho Form for a page on my GoDaddy website to collect leads, which then transfers the data to Bigin. However, I'm facing an issue where it doesn't seem to work properly. I've integrated Zoho Forms with Bigin and tried embedding
      • Can not add fields to a Section

        I feel like I'm missing something obvious: I can add new Sections to my form but I can not add fields to the Sections. I've tried fields already on the form as well as dragging and dropping new fields into the Section but nothing will go into it. What
      • Try FSM again for our business

        We already have our customers individual equipment in CRM with serial numbers, install dates, warranty length and importantly next service which is generally 2 years. a month before the service date is due we get get a report and send out service reminders.
      • Record Logged in User while using CRM lookup field

        Is it possible, while using the Zoho CRM lookup field, to automatically use the user account logged into Zoho CRM in a hidden field? I was hoping to add employee accounts to my current plan. But would like a record on the Form submission of who submitted
      • Form Rules for Suburb Categories to alternate landing pages or Making a Fields Contents ALL CAPS

        I need to send differentform submissions to two to three different thank-you URLs (for Meta/Google pixels) depending on which suburb a user selects in a form. I have ~400 suburbs split into two categories (A and B, based on business value). Current challenges:
      • how to differentiate if whatsapp comes from certain landing page?

        I create a Zobot in SalesIQ to create a Whatsapp bot to capture the lead. I have 2 landing pages, one is SEO optimized and the other want is optimized for leads comes from Google Ads. I want to know from which landing page this lead came through WhatsApp
      • Collaps Notes

        There are times when long/large notes are added to a record i.e. Accounts or Deals etc. Currently, the full note is displayed in the notes related list section. It would be great if by default only 5 to 10 rows of the note are displayed when the note
      • Zoho Down

        I have a drop in my Zoho One services.
      • Runing RPA Agents on Headless Windows 11 Machines

        Has anyone tried this? Anything to be aware of regarding screen resolution?
      • Problem for EU users connecting Zoho CRM through Google Ads for Enhanced conversions

        Has anyone else experienced this problem when trying to connect Zoho CRM through Google Ads interface to setup enhanced conversions? Did you guys get it fixed somehow? The Problem: The current Google Ads integration is hardcoded to use Zoho's US authentication
      • Rich Text For Notes in Zoho CRM

        Hello everyone, As you know, notes are essential for recording information and ensuring smooth communication across your records. With our latest update, you can now use Rich Text formatting to organize and structure your notes more efficiently. By using
      • Whatsapp Limitation Questions

        Good day, I would like to find out about the functionality or possibility of all the below points within the Zoho/WhatsApp integration. Will WhatsApp buttons ever be possible in the future? Will WhatsApp Re-directs to different users be possible based
      • Issue with Inline Images in Email Reply via Zoho Desk API

        Hi, I am attempting to send inline images in an email reply using the Zoho Desk API, but the images are not being displayed inline for the recipient. I have followed this documentation: https://desk.zoho.com/DeskAPIDocument#Uploads https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply
      • How to overcome limitations in meetings

        As a company, one of our deliverables is a meeting between two other companies, where we act as facilitators. So, if we recorded this meeting  in Zoho CRM, it should be connected to 2 accounts, 2 contacts, and 1 campaign (a campaign, in our use, is the
      • India Tech Support

        Is there no phone tech support number for India? And no chat facility either?
      • Billing Management: #1 Billing an Universal Business Routine

        Hello, As the saying goes, "Do the hardest job first", we started with the complex subject in finance, revenue management, which is considered to be the backbone for any business. Now, let's shift our focus and take a deep dive into this Billing Management
      • Show/ hide specific field based on user

        Can someone please help me with a client script to achieve the following? I've already tried a couple of different scripts I've found on here (updating to match my details etc...) but none of them seem to work. No errors flagged in the codes, it just
      • What is a a valid JavaScript Domain URI when creating a client-based application using the Zoho API console?

        No idea what this is. Can't see what it is explained anywhere.
      • Field Dependency Not Working on Detail Page in Zoho Desk

        Hi Support Team, I’ve created field dependencies between two fields in Zoho Desk, and they are working correctly on the Create and Edit layouts. However, on the Detail page, the fields are not displaying according to the dependencies I’ve set — they appear
      • Zoho CRM button to download images from image upload field

        Hello, I am trying to create a button in Zoho CRM that I can place in my record details view for each record and use it to download all images in the image upload fields. I tried deluge, client scripts and even with a widget, but feel lost, could not
      • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (9/25)

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

        Hello customers, We’re excited to share a major revamp to Zoho Inventory that brings both clarity and flexibility to your inventory management experience! Presenting Assemblies and Kits We’re thrilled to introduce Assemblies and Kits, which replaces the
      • Customer Parent Account or Sub-Customer Account

        Some of clients as they have 50 to 300 branches, they required separate account statement with outlet name and number; which means we have to open new account for each branch individually. However, the main issue is that, when they make a payment, they
      • Prevent stripping of custom CSS when creating an email template?

        Anyone have a workaround for this? Zoho really needs to hire new designers - templates are terrible. A custom template has been created, but every time we try to use it, it strips out all the CSS from the head.  IE, we'll define the styles right in the <head> (simple example below) and everything gets stripped (initially, it saves fine, but when you browse away and come back to the template, all the custom css is removed). <style type="text/css"> .footerContent a{display:block !important;} </style>
      • Workdrive 5.0 / API Documentation Workflows

        Hi Zoho, When will the API documentation of the workflows be published? We are interested in using it to trigger manual workflows from an external application. Greetings, Justin
      • Error: Unsupported content type: text/html;charset=UTF-8 after tryeing to get the token for n8n automation

        I am working on ZOHO Desk automation and need to get the ZOHO auth token for n8n I have created the app in ZOHO Desk API, got client id and client secret. Added all data required to get a token in n8n. After I sign in with my ZOHO credentials in ZOHO
      • Replace Lookup fields ID value with their actual name and adding inormation from subforms

        Hi everyone,  I wanted to see if someone smarter than me has managed to find any solutions to two problems we have. I will explain both below.  To start we are syncing data from Zoho CRM to Zoho Analytics and I will use the Sales Order module when giving
      • Webhook from Zobot to Zoho Flow fails

        I'm trying to connect from zobot to zoho flow. When testing in zflow, I am receiving all entered data from the connector correctly. The SalesIQ connector's "outputreaction" is {} (is this normal or is there a problem?). But as soon as I try my chat bot
      • Transition from Sole Proprietorship to GmbH (Limited Liability Company) – Best Approach in Zoho Books / Zoho One

        Hello everyone, I am currently operating under a Zoho One plan with a sole proprietorship in Switzerland. As of January 1st, 2026, I will be incorporating a new legal entity – a GmbH (Swiss equivalent of a Limited Liability Company). While the business
      • Presenting ABM for Zoho CRM: Expand and retain your customers with precision

        Picture this scenario: You're a growing SaaS company ready to launch a powerful business suite, and are looking to gain traction and momentum. But as a business with a tight budget, you know acquiring new customers is slow, expensive, and often delivers
      • Best way to display complex Bookings Consultation Descriptions on Zoho Site?

        I am a new user so apologies if this has been asked before. I couldn't find any answers in the forum. We offer 18 complex Consultations to our subscribers. Our current platform lets me put detail on these Consultations thoroughly (200-300 words) during
      • No Response from Zoho Support in 8 Days - Typical?

        I have a couple of issues I'm trying to work through. Initially, I was getting support from support@zohofsm.com, but I have not received a response in 8 days (11 on another question). Is this typical? Can I pay for support? For context, I am not spamming
      • Cliq iOS can't see shared screen

        Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
      • Age Calculation

        I've attempted to calculate the age of someone based on their birthday input by using the formula field. It works but I don't want all those decimals on there. I then tried to use "set variable" after birthday input but I get a field type mismatch, long vs. floating. Any ideas would be wonderful.
      • Access Denied

        I am iOS Developer and updating our clients project and shifted ZohoDeskPortalCore SDKs from cocoapods to SPM and changed few lines of code but now i am get access denied, the help center app is unavailable. please contact administrator.
      • Using Zoho Desk to support ISMS process

        Hi, I am evaluating using Zoho Desk for security incident management. This seems to be aligned with Zoho Desk purpose as its just another type of incident. However in security incident management, ideally I can link incidents (tickets) with a risk from
      • Filtering Tickets based on Email headers

        We're starting to get a lot more junk coming into our Zoho Desk, which is then triggering unnecessary email alerts to agents. Once thing we could do to cut this junk in half, is to filter tickets based on email headers. Any email containing the `List-Unsubscribe`
      • TaxJar vs Avalara

        Hi, I'm evaluating adoption of a sales-tax service for US based business. Anyone else have experience with TaxJar and Zoho Books? I am a Zoho One subscriber so anticipate needing to use Flow to make this work. It seems like Avalara are simply too expensive
      • How to check Leads with no Task (open activity)

        Hi everyone, I was wondering if there’s a way to view leads that don’t have any tasks assigned or open activities linked to them.
      • Next Page