Desk Contact Name > split to First and Last name

Desk Contact Name > split to First and Last name

I am new to Zoho and while setting up the Desk and Help Center, I saw that new tickets created or submitted from the Help Center used the Contact Name field. This would create a new Contact but put the person's name in the Last Name field only. The First Name field would be blank.
I read another community post about this here: Contact Name - First and Last Name (zoho.com), but the formula did not work for me (probably from not understanding Deluge script.

Upon asking for help from the Zoho team, here is their Custom Function solution:

  1. Navigate to Setup > Automation > Workflows
  2. Create Rule
  3. Execute on > Create (check this box)
  4. Criteria > First Name | is empty
  5. Actions > Custom Function
    1. Name = split_name
    2. Module = Contacts
    3. Argument Mapping (see attached screenshot for reference)
      1. Name = Lname, Value = Contacts.Last Name
      2. Name = Id, Value = Contacts.recordid
  6. SAVE
  7. Navigate to Setup > Developer Space > Functions
  8. Create a New Function
  9. Name = split_name
  10. Category = Automation
  11. Module = Contacts
  12. Write the Deluge code below, using your own Organization ID (see attached screenshot for reference):
  13. Save
  1. orgid = xxxx;
    if(lname.contains(" "))
    {
    zoho.desk.update(orgid,"contacts",id,{"lastName":lname.getSuffix(" "),"firstName":lname.getPrefix(" ")});
    }

That should be it.
I hope this helps others who run into the same problem.
    • Sticky Posts

    • Using Agent Email Address as From Address

      Currently, while replying to a ticket, it is possible for agents to choose their own email addresses as 'from' addresses. Although we built this just for that little extra flexibility, in hindsight, it hasn't figured much in conventional usage.  Almost all businesses prefer that responses to their customers' tickets be sent from the common support/service email address and NOT from those of individual agents. During personal interactions at events, some of you have even made passing mentions about
    • Edit and Delete options in Comments

      A lot of teams have been using ticket comments extensively to collaborate everyday. Notification Center further improved this experience by bringing real-time updates. As we continue to build more improvements to this experience, we've shipped a small-yet-important
    • Webinar 2: Supercharged customer support for growing business

      Join us for this webinar and learn how to step up your support game using a real-time communication platform to generate happier, more successful customers. In this live webinar, we will will discuss the importance of SalesIQ for your support team and how it can help you:  Understand your customers better and their journeys to proactively support and engage them even before they ask for help.  Integrating real time conversations into Zoho Desk’s Support, providing a conversational customer service
    • Customize Colors of your Customer Self Service Portal

      You asked for it. We heard you. We're happy to roll out the most sought after feature request, Customizing the Colors of your Customer Self-service Portal. Now you can set the color of your customer portal to mimic your company's web site, so that your customers visiting the portal will not feel alienated by the default theme.  Go ahead and configure the color of the header, tabs, fonts and background according to your needs. You can either choose between default color themes like Blue, Grey, Green
    • 2024 Email Authentication Standards: Elevating Security with Google and Yahoo

      In contemporary email communication, email authentication plays a pivotal role in mitigating email fraud, spam, and phishing attacks. Brace yourself for a new level of security. Starting February 2024, Gmail and Yahoo will be implementing robust email