Introduction to Slash Commands in Cliq

Introduction to Slash Commands in Cliq

In Steve Jobs' words,

The most precious resource we all have is time.


And rightly so, aren't we all looking for quick ways to perform our tasks? Automating even the most trivial actions, can save us some time and make us more productive. If you are looking for an interface to quickly carry out your actions, then Slash Command is the answer. So today, lets learn about slash commands and also try programming a simple command. 

Now that I've kindled your curiosity, let me give a brief overview about slash commands. Slash commands is an interface, with a fixed syntax and can be triggered to complete your task or perform an action right inside the chat window. If using a slash command is easy, creating one is way more easier and interesting. More about creating and managing slash commands are explained in our help page. Additionally, watch this video on how to create and execute a slash command!



Let us try building a command /weather that can fetch you the weather information of a location. The use case we are looking at here, is to get the weather details for the day or to fetch the weather forecast details for the upcoming five days. 
  
The next step would be to get necessary APIs. The APIs used are from https://developer.accuweather.com/apis. Once you source out the necessary APIs, create the command by giving the name, description, hint followed by command parameters. 

The command parameters (options) we require here are :
- city : To get the location from the user. ( Drop a hint to the user to mention the place name! ) 
 
The command execution flow is given in the flowchart below:


Breaking down the command execution flow in 2 simple steps: 
 
1. Each location is assigned with a location key. To get the weather details for a location, the first step would be to get this location key for the place mentioned in the command input parameter. 
 
2. This location key is then used in either the current conditions URL or the weather forecast conditions URL. This again depends on the command input. 
 
Take a look at the /weather command execution code: 
 
  1. //Define new empty Map expressions, Message and Card - to post message on command execution. 

  2. message = Map(); 
  3. card = Map(); 
  4. card.put("theme","modern-inline"); 
  5. card.put("title","Weather Information"); 

  6. //Store the user entries (options) in the a variable 

  7. place = options.get("city"); 
  8. locationURL = "http://dataservice.accuweather.com/locations/v1/cities/search?apikey=API_KEY&q=" + encodeurl(place) + ""; 
  9. response = getURL(locationURL); 

  10. // Convert the string response to a map to get the "Location Key" from the response. Store the location key in a variable. 
  11. locationkey = response.toMap().get("Key"); 

  12. // Any string passed while executing a command will be stored in"arguments" 

  13. if(arguments.containsIgnoreCase("forecast")) 
  14. //API to get weather forecast for the specified location 
  15. ForecastURL = "http://dataservice.accuweather.com/forecasts/v1/daily/5day/" + encodeurl(locationkey) + "?apikey=API_KEY"; 
  16. forecastdata = getURL(ForecastURL); 

  17. // Convert the response to a map. 
  18. DailyForecasts = forecastdata.toMap().get("DailyForecasts"); 

  19. // From the response obtained, get the information you would like to show in your command response. And organize it in a table and post as a message card! 
  20. slides = List(); 
  21. slidedata = Map(); 
  22. slidedata.put("type","table"); 
  23. rows = List(); 
  24. for each DailyForecast in DailyForecasts 
  25. clock = DailyForecast.get("Date"); 
  26. Time = clock.getDay()+"/"+clock.getMonth(); 
  27. Temp = DailyForecast.get("Temperature").toMap().get("Minimum").toMap().get("Value"); 
  28. Celsius = ((Temp - 32) * 0.5556).round(1) + "°C"; 
  29. row = Map(); 
  30. row.put("Date", Time); 
  31. row.put("Temperature",Celsius); 
  32. rows.add(row); 
  33. }
  34. data = Map(); 
  35. headers = List(); 
  36. headers.add("Date"); 
  37. headers.add("Temperature"); 
  38. data.put("headers",headers); 
  39. data.put("rows",rows); 
  40. slidedata.put("data",data); 
  41. slides.add(slidedata); 
  42. message.put("slides",slides); 
  43. message.put("text","Weather forecast for the next 5 days in "+place ); 

  44. }
  45. else 
  46. CurrentWeatherURL = "http://dataservice.accuweather.com/currentconditions/v1/" + encodeurl(locationkey) + "?apikey=API_KEY"; 

  47. // API to get current weather conditions for the specified location 
  48. current_weather_data = getURL(CurrentWeatherURL); 

  49. // Convert the string response to a map. 
  50. WeatherInfo = current_weather_data.toMap(); 

  51. // From the response obtained, get the information you would like to show in your command response. 
  52. climateinfo = WeatherInfo.get("WeatherText"); 
  53. climate = WeatherInfo.get("Temperature"); 
  54. Metrics = climate.get("Metric"); 
  55. Celcius = Metrics.get("Value"); 
  56. Unit = Metrics.get("Unit"); 

  57. // The required information from the response will be posted as a message 
  58. message.put("text","The weather in " + place + " is " + climateinfo + " with a temparature of " + Celcius + "°" + Unit + ""); 

  59. //Post the message to a chat with the help of the deluge task : zoho.cliq.postToChat (); 
  60. aa = zoho.cliq.postToChat(chat.get("id"),message); 
  61. message.put ("card",card); 
  62. return message; 

And that's how you can use a simple slash command to fetch weather details, right inside your chat window! Let us know how this post helped you. Feel free to post your queries , suggestions here!

Cheers,
Manasa 
Cliq                   


      • Sticky Posts

      • 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
      • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

        Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
      • App Spotlight : PagerDuty for Zoho Cliq

        App Spotlight brings you hand-picked apps to enhance the power of your Zoho apps and tools. Visit the Zoho Marketplace to explore all of our apps, integrations, and extensions. In today's fast-paced world, seizing every moment is essential for operational
      • Automate your status with Cliq Schedulers

        Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick
      • Bulk user onboarding for Cliq Channels in a jiffy

        As developers, we frequently switch between coding, debugging, and optimizing tasks. The last thing we want is to be burdened by manual user management. Adding users one by one to a channel is tedious and prone to errors, taking up more time than we could

        • Recent Topics

        • Zoho Cliq not working on airplanes

          Hi, My team and I have been having this constant issue of cliq not working when connected to an airplane's wifi. Is there a reason for this? We have tried on different Airlines and it doesn't work on any of them. We need assistance here since we are constantly
        • [Free Webinar] AI Agents in Zoho Creator - Creator Tech Connect

          Hello Everyone! We welcome you all to the upcoming free webinar on the Creator Tech Connect Series. The Creator Tech Connect series is a free monthly webinar that runs for around 45 minutes. It comprises technical sessions in which we delve deep into
        • Ship via Carrier Not Working Since Commerce Update

          Since the recent update to the Commerce platform, I can no longer use the ship via carrier function. It will take me to the address screen and let me verify them but when I go to save and move tot he next screen it will not do anything. This is happening
        • automations: Can I execute a step on a specific date?

          I have created a form in Zoho forms, and created a contacts list. I have also begun setting up an automation with the intention of sending the form to the contact list on a specific date every month (via email) for the entire year (essentially sending
        • Zoho Expense - The ability to add detail to a Trip during booking

          As an admin, I would like the ability to add more detail to the approved Trips. At present a requestor can add flights, accommodation details and suggest their preferences. It would be great if the exact details of the trip could be added either by the
        • Adding Folders in Android App

          Is it possible to create a new email folder within the Zoho Mail Android app?  Or can this only be done from the desktop version of Zoho Mail? Cheers!
        • Schedule Exports for Regular Project Updates

          Tracking project data often means exporting data at regular intervals. Instead of manually exporting data every time, users can schedule exports for Phases, Tasks, and Tasks in Zoho Projects. These exports can be set to run once, daily, weekly, or monthly
        • Question about custom fields using Pivot Tables.

          I have created a pivot table showing annual revenue of a client and how much payment that client is paying my company. Is there a way using pivot table to add an additional field that subtracts those to fields / shows me a percentage of that difference?
        • Request for Light/Dark Mode

          Would love the ability to switch between Light and Dark mode similar to Zoho CRM. https://help.zoho.com/portal/en/community/topic/introducing-dark-mode-light-mode-a-new-look-for-your-crm
        • Signature field is showing black

          Hello, When customer signed the service form, it is showing as below picture Phone model: iPhone 16 Pro We tried delete and install application, but it not solved. This has on phone of a few person. There is any advice to solve this?
        • Journey Email - Ignored Contacts

          I have a journey setup which simply sends a string of emails over time. For some reason I am getting large amounts of the contacts who enter the first email being ignored and I can't find anywhere in reports or audit logs why these contacts are not
        • Involved account types are not applicable when create journals

          { "journal_date": "2016-01-31", "reference_number": "20160131", "notes": "SimplePay Payroll", "line_items": [{ "account_id": "538624000000035003", "description": "Net Pay", "amount": 26690.09, "debit_or_credit": "credit" }, { "account_id": "538624000000000403", "description": "Gross", "amount": 32000, "debit_or_credit": "debit" }, { "account_id": "538624000000000427", "description": "CPP", "amount": 1295.64, "debit_or_credit": "debit" }, { "account_id": "538624000000000376", "description":
        • Zoho Books - Include Payment Terms as a Custom View filter

          It would be great if you could created a custom view based on Payment Terms. This would be really handy for seeing a list of customers who have credit terms. A workaround is not required. I could do something with a creditor checkbox, but it would be
        • How to update changed purchase account of item in invoice

          I have selected the wrong purchase account for various articles and created invoices. I had to adjust the purchase account in the article afterwards, but the old purchase account is still posted in the transaction-journal of the invoice. To adjust the
        • Help - Zoho CRM notification on mobile (IOS/Android)

          Hello Community! Can I get the IOS/Andoid CRM app to notify me of events, calls, etc. due as I can with MANY other apps?   I am running the free Zoho I would like this to be native to the Zoho CRM app. I do not want to write a sep. mobile app
        • Zoho Books Idea - Include another field in Bank Details for Address

          Hi Books team, Currently use the Description field in the Bank Details to store the bank's address. This works fine but it would be great if you could add another field for Bank Address, so that other notes about the bank account could be stored in the
        • Reverse payment on accidentally closed invoice.

          An invoice was closed accidentally with the full payment added. However, only partial payment was paid. How can I reopen the invoice and reverse this to update it to show partial payment?
        • a question about the COQL API v8

          When I specify eight or more values in a WHERE IN clause and execute it, an error occurs. Is there a limit to the number of values that can be specified in a WHERE IN clause? ↓Error select * FROM Vendors WHERE (id in (1, 2, 3, 4, 5, 6, 7, 8, 9)) ↓Success
        • Zoho Books Idea - Bank Details Button on Banking

          Hi Books team, Sometimes I'm asked to share bank details with a customer or a colleague. So I go to the Banking Module, find the correct bank account, click Setting > Edit, then copy and paste the bank details. Wouldn't it be great if there was a button
        • JS SDK 8.0 – TypeError: Cannot read properties of undefined (reading 'getCacheStore') with sample code

          Hello Zoho Support Team, I’m integrating the Zoho CRM JavaScript SDK v8.0 and I’m getting the error below when running your official sample. I tested directly from: https://github.com/zoho/zohocrm-javascript-sdk-8.0/blob/main/samples/create_records_sample/create_records.js
        • Function #55: Convert multiple quotes to single SO using Custom Button

          Hello everyone, and welcome back to our series! In Zoho Books, after a quote is accepted by your customer, it can be converted into a sales order or an invoice. Often, a customer might have multiple quotes, and for easier billing or upon the customer's
        • Zoho One - Syncing Merchants and Vendors Between Zoho Expense and Zoho Books

          Hi, I'm exploring the features of Zoho One under the trial subscription and have encountered an issue with syncing Merchant information between Zoho Expense and Zoho Books. While utilizing Zoho Expense to capture receipts, I noticed that when I submit
        • 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
        • Time based workflow without edit/action

          Hello I need help solving this problem if possible. We have Deals come into the CRM via Live Transfer which have the field properties: Stage = New Channel = Inbound Some of them don't get answered so we want these to automatically go into our Outbound
        • What's New - August 2025 | Zoho Backstage

          Every month, Zoho Backstage grows with you. These updates aren't just features and fixes, they're about making your workday smoother, your events more impactful, and your attendees happier. We’ve listened, learned, and shaped this release to keep things
        • prevent selling expired items

          Hello. I need to make a constraint on expired batch items not to be sold. Is it possible in Zoho Inventory? if so, then how? Thanks for further help.
        • Product details removed during update from other system

          We maintain our product details in an other system. These details are synchronized with Zoho at the end of each day, through an API. This has worked perfectly sofar. But last Monday, all product codes and some other product data have been wiped during
        • Client Customer

          I purchased a customer user license, but we cannot see the project I added in the customer account. I would like to ask for support on what we should do.
        • Add Ability to Use Zoho Finance Tags

          For Zoho Finance (Books and Inventory), the current actions do not allow us to affect the tags associated with the entities in question (customers, vendors, items, etc.). Please consider adding this functionality into the actions.
        • Embeded Signing doesn't work on Safari Browser

          We have implemented Zoho Sign in our website by using embeded signing, It works perfectly on Chrome. But it fails on Safari, We get stuck on Zoho Sign Page during redirection from Zoho Sign to our website after signing the document, Please let us know
        • Dataprep Webhook Limits and Cannot update column with Dataprep

          I have two problems : 1 - I am using Airflow to trigger my pipeline, and when I tested it, it worked fine a couple of times. However, after that, I received an error: {"code":429,"message":"Request rate limited"}. I didn’t send too many requests — maybe
        • Power of Automation :: Automatic removal of project users once the project status is changed.

          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 complex tasks and
        • New in Zoho Forms: Google reCAPTCHA v3 for smarter spam protection

          Hello form builders, Spam submissions are one of the biggest challenges when you share your forms online. They not only clutter your data but can also waste valuable time. To help you combat this without making life harder for genuine respondents, we’re
        • Project Management Bulletin: August, 2025

          We’ve touched a grand 19 years since we started pioneering project management solutions with Zoho Projects. What started as a simple one-page interface is now a suite of products with Zoho BugTracker, Zoho Sprints, and our new debut Zoho Projects Plus,
        • Zoho Sign and Zoho Workdrive Integration

          Hello, there. I want to know if it's possible to save a signed document from Zoho Sign in an specific folder for each signer in Zoho Workdrive.  For example: If John Doe signs the document in Zoho Sign I want to save it automatically in a folder named
        • Office 365 and CRM mail integration: permission required

          Has anyone run into this weird problem? My email server is Office 365. When I try to configure Zoho CRM to use this server, a Microsoft popup window opens requesting user and password. After entering that, I get a message in the Microsoft window saying
        • Empowered Custom Views: Cross-Module Criteria Now Supported in Zoho CRM

          Hello everyone, We’re excited to introduce cross-module criteria support in custom views! Custom views provide personalized perspectives on your data and that you can save for future use. You can share these views with all users or specific individuals
        • How do you list multiple contacts for a lead?

          My sales team wants to be able to add additional contacts for leads, how do we do that? Is there a different way we should be using the lead / contact functionality? Moderation update (9th September 2025): Our developers have built an extension to achieve
        • Modifying Three Dot Menu Options

          Is there a way to modify the three dot menu options that display in a Report header? They currently display: Show As (List, Calendar, Timeline), Print, Import, Export. I'd like to remove the Show As and Print options, since they aren't applicable for
        • Elevate your CX delivery using CommandCenter 2.0: Simplified builder; seamless orchestration

          Most businesses want to create memorable customer experiences—but they often find it hard to keep them smooth, especially as they grow. To achieve a state of flow across their processes, teams often stitch together a series of automations using Workflow
        • Next Page