The Slash Command Series - Build a command to create polls!

The Slash Command Series - Build a command to create polls!

Your team has decided to go for lunch and you're in charge of the menu. But before you decide on the menu, it's important to know their preferences. For instance, what if somebody is vegan and you haven't taken that into account!

Now now, we know hard it is to arrange the menu for a small group of 4, let alone for 50.   How can Cliq help this situation you may ask? Ah, simple. Create a poll using Cliq's slash commands!

With /poll command you can just post a message in channel, ask everybody to vote and get the list. The /poll command  helps you collect data, interpret, analyze and make a decision. Let's take a look at the command workflow, it's pretty easy. :D  

Command Workflow  

The command syntax would be   /poll -topic" " - optn " " 

The user would have to just specify the question (topic) and options in the command syntax and execute the command in a chat window. A poll message card is posted with the question and the options as buttons. Now, to wait for everybody to take their pick! 

The poll question and the options are stored as records in Zoho Creator and when an option is chosen, the selection made is also stored as a record.

To put it in a nutshell, this command is a classic example of multiple workflows and integration with other Zoho Products ( i.e Zoho Creator) 

Now there are four parts to the command execution- three in Cliq and one in Creator. Breaking down the command creation and execution  

Store the questions and results - Creator Application 

  • Create an application in Zoho Creator - Refer this  How to create an application help page in Zoho Creator. 
  • Create two forms - for Poll Questions and one for the Poll Results with the necessary fields. 
  • Use the zoho.creator.createRecord task and zoho.creator.getRecord task in your command and function execution code to create and get records from Creator.  Refer this  help page  

Sample Syntax for the create record task :

 

zoho.creator.createRecord("ownerName","appLinkName","formLinkName",dataMap,"connectionLinkNam", userAccess )

 

Get the owner name, appLinkName and formLinkName from the creator application URL. 

 

URL Format:  https://app.zohocreator.com/ownerName/appLinkName#formLinkName

 

Sample URL:  https://app.zohocreator.com/scottfisher5/poll-command#Questions

 

Note: We've attached a sample Poll application file for you. Download and import this file in your creator account to get an idea of the Poll application. 

Connect to the storage - Cliq Connections (authenticated)

Connections are used to integrate your application with other Zoho Applications or Third Party Web Services in an authenticated manner. 

Create a connection to invoke operations on the Creator Application from Cliq, using Cliq Platform. Use the connectionLinkName and define the userAccess parameter in the creator deluge tasks. 

Share the poll with  a group - Cliq commands 

Create a poll command and specify the command parameters. Command parameters will help fetch the question and the options given by the user in the poll. 

The command execution code is attached here. Copy the code in your deluge editor and try executing the command!


  1. message = Map();
  2. card = Map();
  3. card.put("theme","poll");
  4. b = options.get("Topic");
  5. a = options.get("Optn");
  6. buttonnames = a.toList(",");
  7. info buttonnames.size();
  8. card.put("title","POLL");
  9. message.put("text",b);
  10. dataMap = {"Question":options.get("Topic"),"Answers":options.get("Optn"),"Creator":user.get("email")};
  11. respFromCreator = zoho.creator.createRecord("ownerName","appLinkName","formLinkName",dataMap," connectionLinkName ",  
  12. userAccess );
  13. creatorId = respFromCreator.get("values").get("ID");
  14. buttons = List();
  15. for each  name in buttonnames
  16. {
  17. button = {"label":name,"hint":"Choose an option.","type":"+","action":{"type":"invoke.function","data":{"name":"FunctionName","owner":"yourname@yourdomain.com"}},"key":creatorId};
  18. buttons.add(button);
  19. }
  20. info buttons;
  21. if(buttons.size() > 0)
  22. {
  23. button = {"label":"View Result","hint":"Select an option.","type":"+","action":{"type":"invoke.function","data":{"name":"FunctionName","owner":"yourname@yourdomain.com"}},"key":creatorId};
  24. buttons.add(button);
  25. }
  26. info creatorId;
  27. card.put("thumbnail","<insert_image_url>");
  28. message.put("card",card);
  29. message.put("buttons",buttons);
  30. message.put("card",card);
  31. //aa = zoho.cliq.postToChat(chat.get("id"),message);
  32. info message;
  33. return message;

Variables used in the code

Line no 12: You'll find these in your creator application URL

Line no 18 & 24: Give your function name and email ID.

Poll Votes and Results - Cliq Buttons and Functions

  Functions work in association with buttons. Our aim for the function here should be  

  • To allow users to select an answer and store the selection in Creator.
  • To get the list of all answers for the poll when a user clicks the 'View Result' button.
  • To restrict users from answering a poll more than once. 

When a user clicks the 'View Result' option, the function will get records from Creator to display the total number of responses received for the poll. (u se the button name as the criteria for this)

Likewise, when a user tries responding to the poll twice, use the parameter 'Key' to identify if the user has already responded. If yes, then go ahead and show an error message. If no, take the user's response to the poll. 

That sure was a lengthy read. Well, have a look at this video for better understanding! 

So what are you waiting for? Go on and create a poll! Let us know how this command helps you and your team. 

If you're new here, welcome! Take a look at our slash command guide . You can also learn how to connect to accuweather.com and get weather forecast right inside your chat window. Cool right? Then, check this out !

Questions and discussions are welcome!

Until next time,

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
    • 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
    • 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
    • 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
    • Cliq Bots - Get notifications about any action on an application with the incoming webhook handler!

      Webhooks can be used to get notified about events happening in other applications inside Cliq. All bots in Cliq have their own incoming webhook endpoint. This makes it simple to post messages to the bot from external applications. Unlike the send message
    • Recent Topics

    • Weekly Tips: Stay Focused with Email Snooze!

      New Year, New Resolutions Being back at work also means being back to the constant barrage of messages from work and clients. The constant flood of incoming emails can lead to the missing of important messages, especially when you can't respond right
    • Schedule Zoho CRM reports only on Business Days

      Hello, Is it possible to schedule reports only on business days ? We currently get daily sales reports on weekend which has no value since the sales team doesn't work on weekends. Thanks
    • Zoho Payroll's Year in Review 2024

      As we roll into 2025, we'd like to pay tribute to all the milestones we hit in 2024! From releasing out new features that streamlined your workflows to updates that made payroll management smoother, we’ve had a prolific year—all while keeping you, our
    • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

      We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
    • Multiplying Weight of product by Quantity

      I am facing an issue with creating a report that consolidates the total sales volume in kilograms. I have already specified the weight for each product. I have also aggregated the total sales quantity. The key question is: how can I create a report that
    • Confirmation prompt before a custom button action is triggered

      Have you ever created a custom button and just hoped that you/your users are prompted first to confirm the action? Well, Zoho knows this concept. For example, in blueprint, whenever we want to advance to the next state by clicking the transition, it is
    • Frontal interview scheduling - room availability in office using Google Workspace?

      Hi, We're using Zoho Recruit as our ATS and Google Workspace as our email, calendar and resources management. We want to use the interview feature to schedule an in-person (frontal) interview with the applicants. How can we sync the room resources availability
    • Add and Remove Agents from Departments and Groups in Zoho One

      Hi Zoho Flow Team, We hope you're doing well. Currently, Zoho Flow provides an action to add an agent to a group in zoho one, but there is no action to remove an agent from a group or a department. Another action that we find missing is the option to
    • Introducing Hiring Pipeline for Vendor Portal

      Keeping vendors informed about candidate progress is often challenging, leading to communication gaps and repeated follow-ups. To address this issue, we've released an update to the Vendor Portal feature that lets you choose to display candidates' hiring
    • Address Grabber function for Zoho

      I converted from ACT to Zoho. With ACT, I used an add-on called AddressGrabber to scrape the contact information from leads that I buy and contact information contained on emails and websites and directly add it as a new lead or contact. Does anyone know
    • Integrate zoom with zoho bookings please; or add optional times in zoho meetings

      Just like events - these online meetings like zoom need to be integrated with zoho bookings, and there needs to be option for customer to book a time slot. It should not be dictated by CRM user.
    • Add Owner to deluge-created module record note

      Is it possible to include the "owner" aka "creator", of a Note when creating it via delulge? This sets "superadmin" as the Note creator. I need to override it. notemap = Map(); notemap.put("Parent_Id",program_contact_id); notemap.put("Note_Content",program_contact_data.get('Note'));
    • Unique and Random IDs in Zoho Forms: Organize and Secure Your Data Efficiently

      When it comes to form submissions, organizing and identifying entries effectively is crucial. Zoho Forms offers two versatile ID generation options for submissions: Unique ID and Random ID. Each serves distinct purposes, providing flexibility to meet
    • Sort By Date - Deluge

      I have the following code, which normally works to sort calls by created time. Every once in a while, it doesn't work and something sneaks through in the wrong order and I can't figure out why. calls = zoho.crm.searchRecords("Calls","(Owner:equals:" +
    • Iteration through a list - Coming up against a "Failure to update function" error

      Hi there! I've been attempting to get a deluge script working and am running into an error that I have been unable to resolve. The error I am getting is Failed to update function Error at line :18. Improper Statement. Error might be due to missing ';'
    • Can you modify "Last Activity Time" in deluge? If so what's the field name?

      I need to perform some bulk modifications on records in the Leads module, but I need to avoid changing the "last activity time" or "date modified" because I am using those fields to filter and sort leads for follow-up action. I cannot find an answer anywhere
    • How do I define a weekend

      I noticed the default for weekends does not seem to include Saturdays. How can i define weekends to include both Saturdays and Sundays? Thank you.
    • 【Zoho CRM】ポータル機能のアップデート

      ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中からポータル機能のアップデートをご紹介します。 今回の機能アップデートにより、CRMのポータルへのログインがより簡単にできるようになりました。 【目次】 SAMLベースのシングルサインオンについて ポータルへのアクセスリンク送付について 今回のアップデートにより、アイデンティティプロバイダー(IdP)を利用している組織において、SAMLベースのSSO(シングルサインオン)を有効化できるようになりました!
    • Getting error during inserting a record in form of zoho people using zoho api

      import requests import json # Set your access token and Zoho People API base URL access_token = '1000.XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXX' api_base_url = 'https://people.zoho.in/people/api/' # Set the form name and data to be inserted form_link_name
    • UI Arabic

      can i change the member portal UI to arabic in zoho community?
    • Resume template to include profile photo

      Hi, We would love the Resume Template to be able to include their profile photo. How can this be done? Miriam
    • Marking a form as 'done'?

      Hi! I've got a form that staff fill in when moving stock from location to location. I see the entries they've sent across and I input them into my stock control system. Is there a way to mark a form as 'done'? So that I know which entries I've input,
    • Zoho CRM - best way to search an account and assign to a deal

      Hi Everyone I am looking for some advice. I want to find the best way to complete the below steps. We have a deal and once it reaches a certain stage we need to allocate a supplier / vendor to this deal along with the salesperson. I want to add (ideally
    • Zoho Rating

      When I close a ticket, the zoho system automatically sends an email to the customer for them to leave a rating. When they leave a rating, the ticket re-opens and I have to close it again. When I close it again, the zoho system sends the customer an email
    • Zoho GC Flow is not showing in IM Channels

      I have added my social IM channels in zoho desk. Created a GC Flow to automate conversations. But Guided conversations are not showing in any platforms I have chosen; WhatsApp Instagram Messenger Web (Business Messaging) In the flow I mentioned these
    • Sharing Knowledge Base articles across multiple departments

      It would be useful to share some Knowledge Base articles across multiple departments where they are applicable, rather than having to go into other departments to find the article you're looking for. For example. Our reception uses the 'Admin' desk whereas our IT guys use the 'Support' desk, however both divisions would find KB articles about our company intranet useful. Reception does not have access to the support desk, so cannot see articles created in the Support KB. Perhaps you could install
    • Contacts marked as Spam are shown as Contacts in tickets.

      Hi Zoho, If a ticket is marked manually as Spam you get an option to set the contact as Spam as well. It would be great if there was another option to delete this Contact. This would be based on the understanding that it wouldn't be marked automatically
    • Is possible to use ${webhookTrigger.payload.street==null?"No street":${webhookTrigger.payload.street}} for to detect inline a null parameter

      Hi Team I need to know if it's possible to evaluate inline the following parameter, with the objetive to detect a null value ? I would like to use ${webhookTrigger.payload.street==null?"No street":${webhookTrigger.payload.street}} Regards, Pablo
    • Real Estate CRM

      How can I tailor my CRM for real estate? I had seen an image where the CRM included property tabs.
    • Issue with Bulk Edit Triggering Function Multiple Times in Zoho Report

      In our Zoho report, we have observed an issue where executing a function during a bulk edit operation runs the function multiple times—once for each selected report entry. This behavior is causing errors due to overlapping or redundant executions. Our
    • Set recurring tasks in Zoho Support?

      Hello,   We use the task function in Zoho Support to set reminders for "due dates" of important events, such as lease expirations, etc. Is it possible to set some of these as recurring yearly? As of now, we have to reset every task manually after one year. Is there a way to have it reset automatically?   Additionally, is there a way to import a list of tasks and their dates into Zoho Calendar? I have not been able to do it from Zoho Support to Calendar. I tried exporting tasks from Zoho Support,
    • Help - How Can I Enter a Hourly Rate (Global Cost) for our Team for Profitability Reporting?

      Hi everyone, I'm hoping someone can help as I am at a loss and am quite shocked (if true) at the lack of functionality in Zoho Books. We run a company in which we do hourly jobs for clients and we bill based on the hours of work completed. Projects are
    • Schedule a regular backup

      In CRM I have a regular backup setup. I cannot find an option to backup Desk? I would like to take a backup before I test syncing products between CMR and Desk.
    • Limit who can submit a support ticket to your site?

      Does anyone have a use case for needing to limit who can submit tickets via your help portal? Some of our customers want to have end-users view our knowledge base articles and see tickets their IT groups have submitted but they do not want end-users to
    • Is there a way to request a password?

      We add customers info into the vaults and I wanted to see if we could do some sort of "file request" like how dropbox offers with files. It would be awesome if a customer could go to a link and input a "title, username, password, url" all securely and it then shows up in our team vault or something. Not sure if that is safe, but it's the best I can think of to be semi scalable and obviously better than sending emails. I am open to another idea, just thought this would be a great feature.  Thanks,
    • Allow us to disable the Reopen Ticket button after a ticket is closed

      Disabling the Reopen Ticket will allow us to have more control over the ticket's flow. According to support, this is currently not possible. Please add this to let us, the customers, mold the ticketing system into something that we can use for our business
    • How to Enforce Mandatory Fields (Category/Sub-category) Before Closing a Ticket?

      Hi, I'm currently using Zoho Desk and encountering an issue where agents are able to close tickets without filling out mandatory fields, specifically Category and Sub-category. I’ve already set them both as a mandatory field, but it can still be bypassed
    • Admin Control for Default Email Templates in Zoho Desk

      Hi Zoho Desk Team, We would like to request a feature enhancement related to default email templates. Currently, agents can select and set their own default email templates when replying to tickets. However, we believe this setting should be managed centrally
    • Lock out of account after password update

      This is a bit of a catch 22 situation. I updated my account password using password generator in ZohoValut. Now I am locked out of everything, as I cannot get into OneAuth for 2FA, as the password is randomly generated, without getting into ZohoValut,
    • Guidance on Making Zoho Desk Connections Available for All Data Centers

      Hi Team, I’m currently developing an application using Zoho Desk connections to manage OAuth for my third-party products. Could you please advise on the steps required to make it available across all data centers? Looking forward to your thoughts on
    • Next Page