Cliq Bots - How to make a bot respond to your messages?

Cliq Bots - How to make a bot respond to your messages?

Bots are just like your buddies with whom you can interact. They carry out your tasks, keep you notified about your to-dos and come in handy when you need constant updates from a third party application. 

So, how can you make your bot respond to a message?

The bot message handler is a piece of code triggered when a message is sent to the bot. Message handlers help you customise your bot responses to make it look conversational. The message input from the user can be either a string or an option selected from the bot suggestions. 

Let us try building a utility bot, that will bring us the top news from a particular category chosen from the list of suggestions. 
The sample workflow on triggering this handler is given below. 
  • The user pings the bot to get a list of current top trending news. 
  • Message handler of the bot identifies a keyword from the user's input and is triggered to respond with a list of categories for the user to choose from. 
  • Once the user selects an option, the message input is again captured to call the corresponding API.
  • This API response is shared by the bot to the user in a card format!
A sample code snippet for the above-mentioned scenario is given below. Take a look!

  1. response = Map();
  2. categories = {"Business","Entertainment","Gaming","General","Health-and-Medical","Music","Politics","Science-and-Nature","Sport","Technology"};
  3. if(message.containsIgnoreCase("NEWS") || message.containsIgnoreCase(" BREAKING NEWS") || message.containsIgnoreCase("HEADLINES"))
  4. {
  5. list = List();
  6. for each  category in categories
  7. {
  8. entry = Map();
  9. entry.put("text",category);
  10. list.add(entry);
  11. }
  12. suggestion = Map();
  13. suggestion.put("list", list);
  14. response.put("text","Hey " + user.get("first_name") + " ,choose one option from the list! I can help you with these. :smile:");
  15. response.put("suggestions",suggestion);
  16. }
  17. else if(categories.containsIgnoreCase(message))
  18. {
  19. url = getUrl("https://newsapi.org/v2/top-headlines?category=" + message.toLowerCase() + "&language=en&apiKey=<Insert_API_Key>");
  20. newslist = url.get("articles");
  21. rows = List();
  22. count = 0;
  23. for each  news in newslist
  24. {
  25. count = count + 1;
  26. row = Map();
  27. row.put("Headline",news.get("title"));
  28. row.put("View Link","[Read More](" + news.get("url") + ")");
  29. if(count <= 10)
  30. {
  31. rows.add(row);
  32. }
  33. }
  34. return {"text":"Hello! Here's the top news in the " + message + " category!","card":{"theme":"modern-inline","title":"Hi " + user.get("first_name") + " :smile:"},"slides":{{"type":"table","data":{"headers":{"Headline","View Link"},"rows":rows}}}};
  35. }
  36. else 
  37. {
  38. return {"text": "Hello There, this looks like an invalid category! Just try typing *News* or *Breaking News* or *Headlines*"};
  39. }
  40. return response;



The bot message handler is the easiest way to get started with building an interactive bot. So get started with it right away! 

Few useful links:




Comments and suggestions are welcome!

Best,
Manasa
Cliq


    • Sticky Posts

    • Cliq Bots - Post message to a bot using the command line!

      If you had read our post on how to post a message to a channel in a simple one-line command, then this sure is a piece of cake for you guys! For those of you, who are reading this for the first time, don't worry! Just read on. This post is all about how
    • Automate a CRM workflow with Zoho Cliq

      Imagine having a virtual assistant that provides rapid updates to your team through Zoho Cliq, helping you stay on top of your sales processes. After returning from a client meeting filled with updates and action items, managing this information together
    • Automating leave alerts in Zoho Cliq

      The constant ebb and flow of employee absences can disrupt projects and hinder productivity. With Zoho Cliq's leave alert automation, you can easily keep your team informed. Real-time notifications can be sent to team chats, ensuring that everyone stays
    • Automating Employee Birthday Notifications in Zoho Cliq

      Have you ever missed a birthday and felt like the office Grinch? Fear not, the Cliq Developer Platform has got your back! With Zoho Cliq's Schedulers, you can be the office party-cipant who never forgets a single cake, balloon, or awkward rendition of
    • Convert a message on Cliq into a task on Zoho Connect

      Message actions in Cliq are a great way to transform messages in a conversation into actionable work items. In this post, we'll see how to build a custom message action that'll let you add a message as a task to board on Zoho Connect. If you haven't created
    • Recent Topics

    • Best Way to Integrate a Shared Sales Inbox with Zoho CRM

      I’m setting up a shared email inbox (e.g., sales@mycompany.com) for our sales team and want to integrate it with Zoho CRM Leads and Deals so that multiple team members can collaborate efficiently. Since Zoho CRM doesn’t support IMAP for shared inboxes,
    • Campaigns workflow emails going to Spam

      Hi Everyone, Does anyone have a solution for workflow emails going to recipients SPAM folders? Our domain is not on any Blacklists, We have our domain authenticated with SPF, DKIM and DMARC all set up and we still have leads who tell us they are not getting
    • Add and Delete Customer Portal user via Deluge

      Using Creator to build an app involving a customer portal. I'm trying to integrate the customer portal for the first time and it is raising questions, mainly because it's new territory. Is it possible to add a new user to the customer portal via deluge? For example, if an existing user invites/refers another potential user to try our app, is there code to automate via deluge, setting up an account ready to go for them? The referral would include their email address, and a workflow would set up the
    • Unexpected Error in Reports (Pivot Chart, Pivot Table)

      Dear Zoho Support Team, I am facing an issue while creating reports (Pivot Chart, Pivot Table, etc.) in Zoho Creator. When I try to access the report, I receive an unexpected error, and an alert message saying "Undefined" appears with the loading UI.
    • Access invoice custom modules data from API

      Hi, I am using $url = "https://www.zohoapis.eu/invoice/v3/invoices"; $opts = ["http" => [method" => "GET",header" => [ "Authorization: Zoho-oauthtoken $accessToken", "X-com-zoho-invoice-organizationid: $orgId" ] ] ]; From my app to retrieve the invoices,
    • Using IMAP configuration for shared email inboxes

      Our customer service team utilizes shared email boxes to allow multiple people to view and handle incoming customer requests. For example, the customer sends an email to info@xxxx.com and multiple people can view it and handle the request. How can I configure
    • Zoho CRM and Google Sync - delete Contacts?

      If I delete a contact in Zoho CRM, will it also be deleted in Google contacts?
    • Customize the ticket ID for enhanced ticket tracking

      Hello everyone, Ticket IDs in Zoho Desk are the unique reference numbers that are assigned to tickets when they're created. Agents generally use the ticket ID to locate a particular ticket and to reference a ticket in conversations and feeds. When customers
    • For Each (Desk Ticket) Loop

      What I need is some sort of "for each" loop functionality in Flow, this doesn't seem to be a thing, but I'm wondering if someone found some sort of workaround? Here's the whole situation: I have a Flow, which is supposed to be triggered by a custom field
    • Turn off/Disable Lead Approval

      Is there a way to disable the need to approve leads? I thought there was but I can't find any reference to it in help, etc. We don't need an approval process for incoming leads at the moment. Thanks.
    • Change colour on task lists?

      I have many task lists on my project boards, since they are all the same colour they blend in with each other. Is there a way to change the colour of these task lists in the list view?
    • Zoho Flow Doesn't Detect Desk Ticket Custom Field Change

      I have a Flow that is configured to be triggered when a custom field on a ticket changes. I also have a Schedule in Desk that runs a script that changes the custom field. When I change the custom field manually in the Desk interface, the Flow runs as
    • invokeURL to change custom field

      I have a deluge script that currently runs as a Schedule. It works exactly as intended, however I've recently been informed by Zoho that there's some mechanism in place to block changes made by a script when it runs on a schedule from being detected by
    • Currency transition

      We are using Zoho CRM in Curacao, Dutch Caribbean. Our currency is currently the ANG. Curacao will be transition ing from using the ANG (Antillean Guilder) to using the XCG currency (Caribbean Guilder) on March 31st 2025, see: https://www.mcb-bank.com/caribbean-guilder.
    • Email transfer to projects

      We are unable to add comment/map documents to this task. WHY DID THIS HAPPEN? The possible reasons are : 1. Email ID not confirmed. To confirm use the link http://zohosso.wiki.zoho.com/#resendconfirmation 2. You do not have permission to add comment/
    • Stop adding Default ID column to xls exports

      When anything is exported to xls, Zoho adds a column with an ID.  WE DO NOT WANT THIS COLUMN.  We use an automated report to a team.  We have our own tracking number.  1. This makes the report messy, it just pushes OUR data off to the right.  2. We have
    • Este domínio já está associado a esta conta

      Fui fazer meu cadastro na zoho e quando digitei meu domínio recebi essa mensagem que meu domínio estava associado a uma conta que eu nem faço idéia de quem seja. Como que faço pra resolver isso? Atenciosamente, Anderson Souza.
    • Transferring Attachments from Lead to Account

      Hi All, I'm trying to create a function that will transfer attachments in leads to the newly created account. I know there's an option to choose where the attachments go when you click the standard convert button but we have a high volume of conversions
    • New Line in Double Optin Email

      Hello, is it possible to add new lines to the double optin email? This is necessary to add legal informations to the mail, which would look very messy if it is all in one line. Thank you in advance Carsten
    • Cursor Keeps Disappearing in the Email Fields

      I did the recent update to the Zoho desktop app - I'm on PC Windows 11. My cursor keeps disappearing when I try to type in the "To" "CC" "Subject" boxes and typing in the body of the email. I've been trying to just tab through the sections instead of
    • Hourly Permission not getting Calculated

      That is our settings The total calculation should be from 9:37 AM to 3:37 PM, but the hourly permission isn't getting calculated The last entry is hourly permission, it's not
    • Client Script field.setCriteria need the list of possible operators for criteria or the opposite of "equal"

      The gist is to just filter the lookup the countries not listed in the multiselect field. I've been using a client script and this time I would like to set this criteria for the lookup: op.setCriteria("((Specialty_Requirement:equals:" + spec + ")and(Countries_Excluded:not_equal:"
    • Highlight a candidate who is "off limits"

      Hello: Is there a way to highlight a candidate who is "off limits"?  I would like to have the ability to make certain candidate and / or Client records highlighted in RED or something like that.   This would be used for example when we may have placed a candidate somewhere and we want everyone in our company to quickly and easily see that they are off limits.  The same would apply when we want to put a client or former client off limits so no one recruits out of there. How can this be done? Cheers,
    • old invoices (Exchange rate)

      We have been facing an issue and searching for a solution for over a month. Issue: Previously, the exchange rate in Zoho Books and Zoho CRM was incorrect, and invoices were being recorded in Zoho CRM with the wrong exchange rate. After adjusting the exchange
    • Zoho Mail Android app update - View emails shared via Permalink on the app.

      Hello everyone! In the latest version(v2.8.2) of the Zoho Mail Android app update, we have brought in support to access the emails shared via permalink within the app. Earlier, when you click the permalink of an email, you'll be redirected to a mobile
    • How to download Renamed File that already updated to Zoho Creator.

      Hi members, I construct a button with report workflow. link = "https://creatorexport.zoho.com" + zoho.appuri + "report_link_name/File_upload/image-download/" + input.File_upload; openUrl(link,"new window"); This script able to download the file. But I
    • Email signature duplicate

      Hi, For a few weeks, opening the email writer would show an error. After clicking ok, the signature would change slighty (font size, I believe). After that it worked fine, so we thought nothing of it. However, now it no longer shows the error puts the
    • Set a global default filter to All Candidates view

      Hi, Is it possible to set a global filter to the All Candidates view? As a use case would be for off-limit candidates. These are those who are off limits due to previous bad client feedback on performance/behaviour. Ideal use case would be to set these
    • Merge Join PDFs Zoho Creator

      Hi all, I have a field where users upload PDF, is it possible to join those pdfs into one with a function or something? Regards.
    • Custom Sign-in and Sign-out

      I've had a number of users ask me "how do I sign-out" when the sign-out link is clearly on the upper right of the page. To make it more obvious, you can use this bit of code to make a sign-out button on the top of any HTML view. You can customize the serviceurl as needed. <a class="zc-formbutton" style="padding: 5px;font-size:12px;" href="https://accounts.zoho.com/logout?serviceurl=https://creator.zoho.com/<%=zoho.adminuser%>/<%=zoho.appname%>/">Sign-Out</a> And since we're on this topic, you can
    • Tip 26: How to hide the "Submit" button from a form

      Hi everyone, Hope you're staying safe and working from home. We are, too. By now, we at Zoho are all very much accustomed to the new normal—working remotely. Today, we're back with yet another simple but interesting tip--how to hide the Submit button from your forms. In certain scenarios, you may want to hide the submit button from a form until all the fields are filled in.  Use case In this tip, we'll show you how to hide the Submit button while the user is entering data into the form, and then
    • Disappearing Mouse cursor in Zoho Mail / Windows 11 (Chrome + Edge)

      I'm seeing an issue when writing mails with the light theme with the mouse cursor being white and the document area also being white - making it nearly impossible to see the mouse cursor. I see the problem on Windows 11 under Chrome and Edge. (Yet to
    • Introducing Dark Mode / Light Mode : A New Look For Your CRM

      Hello Users, We are excited to announce a highly anticipated feature - the launch of Day, Night and Auto Mode implementation in Zoho CRM's NextGen user interface! This feature is designed to provide a visually appealing and comfortable experience for
    • People 5.0 widget and API questions

      While creating Widget for People 5 I found couple issues that I can’t find answer on my own: 1) How to get leave requests according to this API https://www.zoho.com/people/api/get-records-v2.html. I tried: requestData = { "url": "https://people.zoho.eu/api/v2/leavetracker/leaves/records",
    • Enhancements for Creator in Mobile Browsers and PWAs

      ZC Team, Lady & Gentlemen! This enhancement has been awaited for a thousand years, and it has made my day! It now appears more "enterprise" and no longer a jerk.
    • Zoho CRM Functions 53: Automatically name your Deals during lead conversion.

      Welcome back everyone! Last week's function was about automatically updating the recent Event date in the Accounts module. This week, it's going to be about automatically giving a custom Deal name whenever a lead is converted. Business scenario Deals are the most important records in CRM. After successful prospecting, the sales cycle is followed by deal creation, follow-up, and its subsequent closure. Being a critical function of your sales cycle, it's good to follow certain best practices. One such
    • Perfomance Management - Zoho People

      Hi team, I am looking for performance management data such as KRA, goals, feedback, appraisals, etc., in Zoho Analytics. However, I am unable to find these metrics while editing the setup. Could you please confirm whether these fields are available in
    • Client Script - Updating Field Value in Detail Page of a Lead

      Hello, I'm trying to use Client Script To enrich some data of the Lead when one of my User fill the "City" field in the detail page of the Lead. This is my Script: log (value); var response = ZDK.Apps.CRM.Functions.execute("getInfoCitta", { "nomeCitta":
    • Sales Returns - Repairand Return

      Hi Inventory Team, I'm working with a client on an Inventory implementation project and they have shared this use case with me. Some items may be returned by the customer, then returned to the vendor for repairs, received from the vendor and shipped back
    • Zoho One and Zoho Learn

      Is Zoho Learn going to become part of Zoho One? If not, why not? Also, if not, what is the closest product offered in the One bundle which is comparable to Zoho Learn? Please help me understand the overall relationship between Zoho Learn and Zoho One.
    • Next Page