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

      • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ (9/25)

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

        Coming to this forum as Zoho Calendar support team is not responding, any more. For the past 8 weeks, I have been having an issue with Zoho Calendar not syncing with my personal Google Calendar correctly. I subscribed to Zoho Calendar iCal in my personal
      • 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
      • need a packing list feature

        In our business, goods listed on an invoice are packed in separate boxes and shipped off. for e.g. an invoice may have 10 items. each item could then be packed in different boxes depending on qty of each item. this packing list is as important as the invoice for purposes of shipping documents.  Request you to add this feature asap.
      • How do the keyword critera work?

        Hi, I'm working on automated assignment of tickets based on keywords. How does this feature work? Where does this criteria look for keywords - email address, subject, email body? Can you please clarify this as I want to avoid overlapping with criteria
      • 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
      • How to keep track of bags, cans, drums of inventory?

        We buy and sell products that are packaged in bags 🛍️, cans🥫, drums🛢️, etc. with batch numbers. When we get a shipment of one of the products, how do we track we received (say) 10 cans each of 5L of a product and maybe we received 10 cans of another
      • Zoho Error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details

        Hello There, l tried to verify my domain (florindagoreti.com.br) and its shows this error: This Operation has been restricted. Please contact support-as@zohocorp.com for further details. Screenshot Given Below -  please check what went wrong. Thanks
      • How many ZOHO-Sites does the ZOHO-One Suite allow for?

        The free version of ZOHO-Sites allows for two sites, but it seems that the professional version (which is included in the ZOHO-One Suite) only allows for two websites. Is that correct? How many sites can I have within one ZOHO-One account?
      • 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
      • Having Trouble Opening The Candidate Portal

        Recently am having trouble opening the Candidate Portal. It keeps loading but cannot display any widgets. Tried Safari, Chrome and Edge. Non of them work. Please solve the problem ASAP.
      • 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
      • DKIM cannot be enabled for the domain as no verified default selector present

        Hi Support Team, For Domain DKIM record trying to enable status. but showing error "DKIM cannot be enabled for the domain as no verified default selector present" So, please resolve the issue. Thank you.
      • Issue Connecting My Domain to Zoho Sites Despite Purchasing It from Zoho

        Hello, I am facing an issue connecting my domain to my website on Zoho Sites. Details of the issue: I purchased the domain directly from Zoho. I am already using the same domain successfully with Zoho Mail. However, when I try to assign this domain to
      • Insert auto number from main form into subform rows

        Hello. I'm trying to take from my main form "order number" which i have setup as an auto generated number into every line created in my subform. So when a row is created in my subform i want the "order number " from the main form to be inserted automatically.
      • Dark Mode - Font Colors Don't Work

        When editing a document in Dark Mode and selecting font colors, they don't show up on screen.  Viewing/editing the same document in Light Mode shows them just fine.
      • Integrate Bunq with ZOHO Bookes

        We are new users of ZOHO Books, and our bank (BUNQ, in the Netherlands) isn't listed on the bank integrations. Is there a way to handle this?
      • 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
      • Improving Collaboration Features in Zoho Portal

        Hello Zoho Community, I’ve recently started exploring Zoho services and I’m really impressed with the wide range of features. However, I feel there is still room for improvement in the collaboration area. For example, it would be really helpful if we
      • 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
      • Bin Locations

        Dear all, I am wondering if someone has the ability to develop the bin locations option for zoho inventory (integrated with zoho books) Regards, Ryan
      • 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.
      • What can we do on our end to improve the Answer bot answers?

        Hi, I'm using the Answer bot card in the Codeless bot builder. I've input several questions and their answers in the FAQ section to feed the Answer bot. The text is all in French, as this is the language our customers communicate in. I've tried testing
      • Zoho Books Sandbox environment

        Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
      • Taxes for EU B2B Transactions

        Currently, ZC doesn't seem to have a procedure for validating VAT numbers of businesses purchasing in another EU state, and removing local VAT is valid.  This is essential for all inter EU B2B trade.
      • How to upload file to Connect using API?

        Hi there. I looked at the API documentation and nowhere did it mention how to use the API method to upload a file even though it is mentioned that it is possible to be done so. Please help.
      • Items Landed Cost and Profit?

        Hello, we recently went live with Zoho Inventory, and I have a question about the Landed Cost feature. The FAQ reads: "Tracking the landed cost helps determine the overall cost incurred in procuring the product. This, in turn, helps you to decide the
      • How can I setup Zoho MCP with Chat GPT

        I can set up custom connections with Chat GPT but I cat an error when I try to set it up. The error is: "This MCP server can't be used by ChatGPT to search information because it doesn't implement our specification: search action not found" Thoughts?
      • Deluge - Can't get phone number SalesIQ

        Hey folks, I’m building a custom plug for SalesIQ that’s supposed to register leads into Zoho CRM. The SalesIQ chat is being implemented on WhatsApp, and in my plug I’m using this line: mobile_clean = session.get("phone").get("value"); From what I understand,
      • Group Tax in Service Line Items

        Hi FSM Team! I noticed that when you update a tax in the service line item the group tax is not showing up as an option. Let me know what can be done thank you!
      • Zoho Campaigns - Why do contacts have owners?

        When searching for contacts in Zoho Campaigns I am sometimes caught out when I don't select the filter option "Inactive users". So it appears that I have some contacts missing, until I realise that I need to select that option. Campaigns Support have
      • FSM Improvement Idea - Show an Import button when there is no data

        I am setting up FSM for a client and I noticed that there is no option to import data, see screenshot below. Even when you click Create Contact there is only an option to Import from Zoho Invoice. It is only after you add at lease 1 record that the Import
      • Next Page