Convert a message on Cliq into a task on Zoho Connect

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 a board in Zoho Connect, then head over to this help document to know how to create one. 

For this example, we've created a board for the Zylker Campaigns team in Zoho Connect. The board has three sections: User Interface, Content Marketing, Customer Support. We'll see how the marketing team discusses about upcoming marketing initiatives and keeps track of tasks in their connect board. 



The workflow behind creating this message action is pretty simple. 

1. Once a user clicks on the Add Connect Task message action, the action's handler is triggered to display a form. 
2. The user fills all the information required. We use the form change handler to modify the form field values based on the users' inputs. For example, display networks that the user is a part of by default and on selecting a specific network, we'll show the list boards that the user is a part of under the selected network. The same applies for sections as well. 
3. On choosing the respective network, board and section, the user can add the task title, description, due date, assignee and more. Note that, the message on which the action was performed will be displayed as the task title by default. This can be modified.
4. On clicking Add Task, the form submit handler is invoked to create a task in Connect with all the provided details. 

Prerequisites
Create a connection between Cliq and Connect: 
You'll need an active connection between Cliq and Connect. To create a connection, 
  1. Click on your display picture. This will open up the user panel. Now, click on Bots & Tools
  2. Click on the Connections icon present on the left side menu of the Bots & Tools page. 
  3. Now, click on Create Connection
  4. In the Add Connections view, select the Zoho Oauth option. 
  5. Name your connection. For example you can name your connection: zoho_connect or zohoconnect and choose the following scopes: zohopulse.networklist.READ, zohopulse.tasks.READ, zohopulse.tasks.CREATE
  6. Make sure the Use Credentials of Login User option is enabled. 
  7. Click on the Create and Connect button to generate the invoke URL task with the connection name. 
We'll be using this invoke URL task in our code. 

Create a message action 

To create a message action on Cliq, 

  1. Click on your display picture. This will open up the user panel. Now, click on Bots & Tools. 
  2. Click on Message Actions in the left pane.
  3. Click on the Create Message Action button and fill in the required details. 
    Action Name: Provide your message action name. This field is mandatory.
    Hint: Brief explanation about the message action.
    Access Level: Decide who gets to access your message action. Choose between Organization, Team and Private. Default option is Private.
    Choose what kind of messages should have the message action. Options are Text messages, Attachments and Links. For this example, we're choosing messages of the type Text
  4. Click on Save & Edit Code. 
Create a form function

To create a form function on Cliq, 

  1. Click on your display picture. This will open up the user panel. Now, click on Bots & Tools.
  2. Click on Functions in the left pane. Click on the Create Function button and fill in the required details. 
  • Name: Give your function name. Ensure to use the same function name in your form's code as well. 
  • Description: Briefly describe how your function works. 
  • Function Type: Choose the component with which the function should be associated. For this example, we're using the function of the type: Form 

Step 1: Configuring the message action handler
The message handler is triggered to return the Create Task form as a response. 

  1. messageText = message.get("content").get("text");
  2. getNetworks = invokeurl
  3. [
  4. url :"https://connect.zoho.com/pulse/api/allScopes"
  5. type :GET
  6. connection: "" // Give your connection name
  7. ];
  8. getNetworks = getNetworks.get("allScopes").get("scopes");
  9. netWorkOptions = List();
  10. for each  network in getNetworks
  11. {
  12. networkList = Map();
  13. networkList.put("label",network.get("name"));
  14. networkList.put("value",network.get("id"));
  15. netWorkOptions.add(networkList);
  16. }
  17. inputs = list();
  18. inputs.add({"type":"select","name":"networks","label":"Network","hint":"Select a network","placeholder":"Select a network!","mandatory":true,"value":"","options":netWorkOptions,"trigger_on_change":true});
  19. inputs.add({"type":"select","name":"boards","label":"Boards","hint":"Select a board","placeholder":"Select a board!","mandatory":true,"value":"","options":netWorkOptions,"disabled":"true","trigger_on_change":true});
  20. inputs.add({"type":"select","name":"sections","label":"Section","hint":"Select a section","placeholder":"Select a section!","mandatory":true,"value":"","options":netWorkOptions,"disabled":"true"});
  21. inputs.add({"name":"title","label":"Title","placeholder":messageText,"value":messageText,"hint":"Enter your task name","min_length":"0","max_length":"50","mandatory":true,"type":"text"});
  22. inputs.add({"type":"textarea","name":"note","label":"Description","hint":"Describe your task.","placeholder":"To be done by Tuesday","mandatory":false});
  23. inputs.add({"name":"duedate","label":"Due by","placeholder":"Give your task's due date.","mandatory":false,"type":"date"});
  24. inputs.add({"type":"select","name":"priority","label":"Priority","hint":"Choose your task priority","placeholder":"High","mandatory":true,"value":"High","options":{{"label":"No Priority","value":"None"},{"label":"Low","value":"Low"},{"label":"Medium","value":"Medium"},{"label":"High","value":"High"}}});
  25. addTask = {"name":"addTask","type":"form","title":"Add a task","hint":"Add a task to a board in Zoho Connect. ","button_label":"Add Task","inputs":inputs,"action":{"type":"invoke.function","name":"connectTask"}};
  26. return addTask;





Step 2: Configuring the form change handler

The form change handler will be triggered when the user is filling up the form. The handler is responsible for modifying the form field values based on the user's inputs. 

  1. targetName = target.get("name");
  2. inputValues = form.get("values");
  3. networkID = inputValues.get("networks").get("value");
  4. actions = list();
  5. if(targetName.containsIgnoreCase("networks"))
  6. {
  7. getBoards = invokeurl
  8. [
  9. url :"https://connect.zoho.com/pulse/api/myBoards"
  10. type :GET
  11. parameters:{"scopeID":networkID}
  12. connection:"" // Give your connection name
  13. ];
  14. getBoards = getBoards.get("myBoards").get("boards");
  15. boardOptions = List();
  16. for each  board in getBoards
  17. {
  18. boardList = Map();
  19. boardList.put("label",board.get("name"));
  20. boardList.put("value",board.get("id"));
  21. boardOptions.add(boardList);
  22. }
  23. actions.add({"type":"update","name":"boards","input":{"type":"select","name":"boards","label":"Boards","hint":"Select a board","placeholder":"Select a board!","mandatory":true,"options":boardOptions,"trigger_on_change":true}});
  24. }
  25. else if(targetName.containsIgnoreCase("boards"))
  26. {
  27. boardId = inputValues.get("boards").get("value");
  28. getResponse = invokeurl
  29. [
  30. url :"https://connect.zoho.com/pulse/api/boardSections"
  31. type :GET
  32. parameters:{"scopeID":networkID,"boardId":boardId}
  33. connection:"" // Give your connection name
  34. ];
  35. getSections = getResponse.get("boardSections").get("sections");
  36. sectionOptions = List();
  37. for each  section in getSections
  38. {
  39. sectionList = Map();
  40. sectionList.put("label",section.get("name"));
  41. sectionList.put("value",section.get("id").toString());
  42. sectionOptions.add(sectionList);
  43. }
  44. getMembers = getResponse.get("boardSections").get("members");
  45. if(getMembers.isempty() == false)
  46. {
  47. boardMembers = List();
  48. for each  member in getMembers
  49. {
  50. memberList = Map();
  51. memberList.put("label",member.get("name"));
  52. memberList.put("value",member.get("zuid"));
  53. boardMembers.add(memberList);
  54. }
  55. actions.add({"type":"update","name":"sections","input":{"type":"select","name":"sections","label":"Section","hint":"Select a section","placeholder":"Select a section!","mandatory":true,"options":sectionOptions}});
  56. actions.add({"type":"add_after","name":"duedate","input":{"type":"select","name":"members","multiple":true,"label":"Assignees","hint":"Add assignees","placeholder":"Assign task to a member","mandatory":false,"options":boardMembers}});
  57. }
  58. else
  59. {
  60. actions.add({"type":"update","name":"sections","input":{"type":"select","name":"sections","label":"Section","hint":"Select a section","placeholder":"Select a section!","mandatory":true,"options":sectionOptions}});
  61. }
  62. }
  63. return {"type":"form_modification","actions":actions};



Step 3: Configuring the form submit handler

We'll call the create task API in form submit handler. The submit handler typically receives all the inputs filled by the user and will be triggered on form submission. 

  1. response = Map();
  2. formValues = form.get("values");
  3. scopeID = formValues.get("networks").get("value");
  4. boardId = formValues.get("boards").get("value");
  5. sectionId = formValues.get("sections").get("value");
  6. title = formValues.get("title");
  7. priority_value = formValues.get("priority").get("value");
  8. parameters = {"scopeID":scopeID,"boardId":boardId,"sectionId":sectionId,"title":title,"priority":priority_value};
  9. desc = formValues.get("note");
  10. if(desc != "" && !desc.isEmpty())
  11. {
  12. parameters.put("desc",desc);
  13. }
  14. duedate = formValues.get("duedate");
  15. if(duedate != "" && !duedate.isEmpty())
  16. {
  17. duedate = duedate.toList("-");
  18. eyear = duedate.get(0);
  19. emonth = duedate.get(1);
  20. edate = duedate.get(2);
  21. parameters.put("eyear",eyear);
  22. parameters.put("emonth",emonth);
  23. parameters.put("edate",edate);
  24. }
  25. assignee = formValues.get("members");
  26. if(assignee != {} && !assignee.isEmpty())
  27. {
  28. userIds = list();
  29. for each  assgineeID in assignee
  30. {
  31. userIds.add(assgineeID.get("value"));
  32. }
  33. parameters.put("userIds",userIds.toString());
  34. }
  35. addTask = invokeurl
  36. [
  37. url :"https://connect.zoho.com/pulse/api/addTask"
  38. type :POST
  39. parameters:parameters
  40. connection:"" // Give your connection name
  41. ];
  42. if(addTask.get("addTask").get("stream").isEmpty() == false)
  43. {
  44. taskTitle = "[" + addTask.get("addTask").get("stream").get("task").get("title") + "](" + addTask.get("addTask").get("stream").get("url") + ")";
  45. taskpriority = addTask.get("addTask").get("stream").get("task").get("priority");
  46. tasksection = addTask.get("addTask").get("stream").get("task").get("section").get("name");
  47. taskboard = addTask.get("addTask").get("stream").get("partition").get("name");
  48. response = {"text":"Task added in " + taskboard + ". Take a look at the task details below.","card":{"title":"Task Details","theme":"modern-inline"},"slides":{{"type":"label","title":"Task Details: ","data":{{"Title":taskTitle},{"Priority":taskpriority},{"Section":tasksection},{"Board":taskboard}}}}};
  49. }
  50. return response;






End notes: 

Message actions in Cliq are super versatile like all other Cliq platform components. You can choose to create a message action that's specific to a message type. This example can be customized even to suit messages of the type attachments and links. So go ahead and give it a try! You can download the source code file attached with this post or access this link here: https://workdrive.zohoexternal.com/external/6OxchwzzBCF-J8HFH

Useful Links: 
Zoho Connect Rest API Guide: https://www.zoho.com/connect/api/intro.html


    • 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

    • New integrations for Bigin: Zoho Sign, SalesIQ, and Marketing Automation

      Greetings, We're excited to share new integrations that make Bigin more powerful and useful for your business! Zoho Sign for Bigin Zoho Sign now integrates seamlessly with Bigin, enabling you to sign, send, and manage contracts or agreements without leaving
    • Add multiple users to a task

      When I´m assigning a task it is almost always related to more than one person. Practical situation: When a client request some improvement the related department opens the task with the situation and people related to it as the client itself, the salesman
    • What is Attendee Status 0 and 1?

      Hi there, I recently stumbled upon the API to get the attendee list and in the return value, there is a parameter called "status", and 0 supposed to mean not_attending, and 1 means attending. I cannot find this representation anywhere in the attendee
    • How to add a Data Updated As Of: dynamically in text?

      I need to add a "Data Updated As Of" in the dashboard to show when was the last date the data was updated. I tried to create a widget but it does not look really good, see below. Is there a way I can do this through the text widget and update it automatically
    • ZOHO BackStage

      How to get list of events, using ZOHO BackStage APIs. Is it possible OR not?
    • Email with attachments saving attachments into Zoho CRM from Zoho Mail

      Hi, I get a lot of emails from prospective clients asking if we would bid their project. Those projects usually have many documents associated with them that I link to.  I would like to have those documents be saved as an attachment in my Potential or Contact or Account. I don't see a way to do that that isn't multi-step. As of now I do the following: 1.) Open email 2.) If email sender isn't in my Zoho CRM database I enter them creating a Potential 3.) I download the attachment and save it to a different
    • Directly Edit, Filter, and Sort Subforms on the Details Page

      Hello everyone, As you know, subforms allow you to associate multiple line items with a single record, greatly enhancing your data organization. For example, a sales order subform neatly lists all products, their quantities, amounts, and other relevant
    • Request For Quotation (RFQ) module

      Hello, Do you have any plans to implement a RFQ module in to ZOHO Inventory? I would like to chose items that I require a price for, select a number of different suppliers to e-mail and have them submit there pricing online. I would then like to see a
    • How to Customize Task Creation to Send a Custom Alert Using JavaScript in Zoho CRM?

      Hello Zoho CRM Community, I’m looking to customize Zoho CRM to send a custom alert whenever a task is created. I understand that Zoho CRM supports client scripts using JavaScript, and I would like to leverage this feature to implement the alert functionality.
    • Lookup Fields not Converting

      I manage holiday properties. I have a lookup to the Accounts (Properties) in the Leads module. The lookup is connected to the property address field. When I convert it the lookup field does not update in Deals, although the property address does. There
    • Zoho Meeting iOS app update - Join breakout rooms, access polls, paste links and join sessions, in session host controls

      Hello, everyone! In the latest iOS version(v1.7) of the Zoho Meeting app, we have brought in support for the following features: Polls in meeting session Join Breakout rooms Paste link in join meeting screen Foreign time zone in the meeting details screen.
    • Calculate hours between 2 date/time fields

      Hi, Does anyone know if it is possible to get the number of hours between 2 date/time fields in a zoho crm custom function? Thanks, Michael
    • External ID validation.

      I added an external ID field as below in one of my custom modules: When creating records via the API using some value (eg: 762115b2-097e-43b2-bdba-f3924a5371a6) for this field, it works without any problem. I can create and even see the records on the
    • Sales Order, what are the statuses under Confirmed and Closed

      Hi, I have to build a workflow in Deluge which should be triggered when Sales Order status is Confirmed or Closed. But these 2 states don't exist when you fetch a sales order. Which of the statuses are considered as Confirmed or Closed ? Here is a list
    • CRM x WorkDrive: File storage for new CRM signups is now powered by WorkDrive

      Availability Editions: All DCs: All Release plan: Released for new signups in all DCs. It will be enabled for existing users in a phased manner in the upcoming months. Help documentation: Documents in Zoho CRM Manage folders in Documents tab Manage files
    • Remove Address from credit card payment

      I would like to remove the need to add address when paying by credit card. I only want the customer to have to add their credit card details.
    • Copy Widget to another Dashboard

      I can see the option to clone a widget to the same dashboard but is it possible to copy it to another dashboard?
    • Create a button that executes a customized function

      Hello, I have created a summary view in which I combine the data from my items table and suppliers table. I would like to know if there is the possibility of adding a button somewhere in the view to be able to execute a function when clicked on it. I
    • Custom field doesn't fill when converting sales order to invoice

      Hi, When I convert a Sales Order to an Invoice one of the custom fields on a product line names "Subsidie" does not seem to fill in automatically. I manually have to select the product again by clicking on the product name in the order line en re-select
    • Can I use ZOHO calendar to schedule a Youtube video that is already in my youtube account, but listed as private or unlisted?

      I am creating Youtube videos and shorts and then uploading them to our Channel so others can view and approve. Once approved I would like to just schedule them over the next few days within Zoho. So far it looks like I have to re-upload the video to Zoho
    • How to Display a Logo Image on a Public Form?

      I would like to display a logo image in the header of a form. To achieve this, I added an Add Notes field to the form. The code below works perfectly for Zoho users accessing the form. However, when the form is made public, the image does not load properly:
    • Advice for my first project in Zoho

      Hello, how can I design and implement a customized ERP and CRM system using Zoho to automate and manage core business functions, including customer relationship management, property inventory, sales tracking, and financial processes. This is one of my
    • Associate Email API Internal Error

      I am trying to associate an already existing email within a function using the Related Emails API. To provide more context, I also have admin permissions and have ensured that the fields are correct and that I have admin permissions when associating the
    • Profit on Sales order

      Hi, would it be possible to implement a column at the Sales order overview of Purchase amount? So a field with the amount of all purchase related to this Sales order? This is very usefull so you will see the profit you made on this deal. I tried to get
    • Subform Data in v2 REST API

      What is the mechanism for adding subform data in the Creator v2 REST APIs?  There is nothing documented in the Data APIs documentation (https://www.zoho.com/creator/help/api/v2/).   I was able to determine how to GET the subform data by adding it to the
    • ZOHO Widget SDK not loading in html

      I have this code below, I have imported the widgetsdk however I get the error shown in the image, I have tried many different ways of importing and initiating the function ZOHO but nothing is working. can someone explain what I'm doing wrong, if I am
    • Information problem

      ZOHO Guys, I am trying to evaluate your product as a serious business tool. However your attitude to providing key information such as 1. CRM Data Model 2. Product Roadmap and Enhancement promises 3. Complete and accurate help make it very difficult to recommend as a serious choice for small business. You may be cheap, but I would prefer to pay if it means not being kept in the dark! Kind Regards Andrew Copley
    • How to create comparison time periods like these examples

      In a Pivot Report I would like to be able to select any date range and show a set of metrics for that date range e.g. revenue, orders, units sold. I would then like to be able to compare to the previous period based on the amount of days on the selected
    • Overwrite Option for custom modules

      Hi Team, I noticed that the overwrite option is unavailable in Zoho Books when importing data for custom modules. This limitation makes it challenging to bulk update old data, as the only option is the 'bulk update' feature, which is restricted to 25
    • Zoho Creator - Zoho Analytics

      I am facing an issue in Zoho Analytics where I am still seeing deleted data from the Zoho Creator form I created. Could you please look into this and let me know what needs to be done?
    • Important updates to Zoho CRM's email deliverability

      Last modified on: Jul 24, 2024 These enhancements are released for all users across all data centers. Modified on: Oct 30, 2023 Organisations that are in the Enterprise and above editions of Zoho CRM, and have not authenticated their email-sending domains
    • Unable to send emails

      I have this email parth@mrcolumbus.in, but I couldnt send outgoing email. Can you please help?
    • Notifications push : Encourager le réengagement et renforcer la fidélité des utilisateurs efficacement

      Vous avez déjà souhaité engager et communiquer de manière proactive avec les utilisateurs, y compris lorsqu'ils utilisent votre application de manière peu active ? Zoho Apptics vous offre déjà des fonctionnalités qui vous permettent d'évaluer la performance,
    • Easy way to delete attachments

      I've reached my data limit and would like to run a view/report, and mass delete attachments. Is there an easy, fast way to do this? Moderation Update: Post Summary: There are two features the post discusses a) Easy way to remove Email attachments Will
    • How to add new deal to existing contact

      Hi, I want to add new deal to existing contact.
    • Domain verification is in progress... (How long do I need to wait?)

      Trying to setup my first email domain by connecting with GoDaddy. Have been here for quite some time and the screen is not changing. How long should this take?Send DataSend Data
    • Linking an email to a Contact when the email is sent in deluge via sendmail

      The "to:" address in this code is a CRM Contact. Email address is forced unique in CRM This sendmail gets sent via a workflow which is in a custom module. It works, except that the outbound email does not appear (i.e, get linked to) the Contact such that
    • How to restore deleted Field

      I edited a field in zoho form and by accident I deleted a field (email address). The form is ongoing to be filled by respondent. Then, when I checked to the all entries and report, the email address is gone. I checked in audit log, there is a record that
    • How to select multiple notes at once in the PC client?

      In the PC client, you can select notes using ctr+LMB. But why can't you use shift+LMB? PC version 3.2.0
    • Create Your Own Issue Management System

      Effective issue management is a cornerstone of project success. Every bug or issue, no matter how small, needs to be tracked and resolved in time to maintain project momentum. In this post, we’ll explore how an issue management system in Zoho Projects
    • Next Page