Bulk user onboarding for Cliq channels in a jiffy

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 devote to actual development. 



Let's explore how to create a custom workflow using Cliq's platform components to streamline the process of bulk-adding users to a channel via a Zoho Sheet or CSV file. This approach facilitates a smooth onboarding experience without the need for manual effort.

Pre-requisite :

Before beginning to script the code below, we must create a connection with Zoho Cliq. Once a connection is created and connected, you can use it in Deluge integration tasks and invoke URL scripts to access data from the required service.

Create a Zoho Oauth default connection with any unique name and the scopes -  ZohoCliq.Channels.All and ZohoSheet.dataApi.ALL

Refer to the below links to learn more :

Step 1  : Creation of slash command

  • After a successful login in Cliq, hover to the top right corner and click your profile. Post clicking, navigate to Bots & Tools > Commands.
  • At your right, click the button - Create Command.
  • To know more about slash commands and their purposes, refer to Introduction to slash commands.
  • Create a slash command using your preferred name. Specify the following details: the command name, a hint (to give users an idea of what the command is for), and the access level.
  • Finally, click "Save & edit code".

  1. inputs = List();
  2. inputs.add({"name":"channels","label":"Pick a channel","placeholder":"Choose a channel where you need to add members","max_selections":"1","multiple":false,"mandatory":true,"type":"native_select","data_source":"channels"});
  3. inputs.add({"name":"headername","label":"Header name","placeholder":"Email ID","hint":"In which the Email ID is present","min_length":"0","max_length":"25","mandatory":true,"type":"text"});
  4. inputs.add({"type":"radio","label":"Import type","name":"import_Type","hint":"Choose a type that you need to import users","options":[{"label":"CSV","value":"csv"},{"label":"Zoho sheet","value":"zohosheet"}],"trigger_on_change":"true"});
  5. return {"name":"addbulkuser","type":"form","title":"Add bulk users","hint":"To add maximum of upto 1000 users in a channel.","button_label":"Add Users","inputs":inputs,"action":{"type":"invoke.function","name":"addbulkusers"};

Step 2  : Scripting form function

  • We need to create a function for the form that manages submission responses, including the Zoho Sheet link or CSV file, the name of the column containing the email addresses, and the channel details where users should be added in bulk.
  • Hover to the top right corner and click your profile. After clicking, navigate to Bots & Tools > Functions.
  • To your right, click the Create Function button.
  • Name the function "addbulkusers," provide a description as desired, and select "form" as the function type. Then, click "Save and edit code," and paste the following code.
  1. emailIdList = list();
  2. successlist = list();
  3. failedlist = list();
  4. try 
  5. {
  6. info form;
  7. formValues = form.get("values");
  8. columnName = formValues.get("headername");
  9. headerName = formValues.get("headername");
  10. if(formValues.get("import_Type").get("value") == "zohosheet")
  11. {
  12. url = formValues.get("url");
  13. spreadSheetId = url.getPrefix("?").getSuffix("open/");
  14. sheetName = url.getSuffix("?").getPrefix("&").getSuffix("=");
  15. worksheetname = sheetName.replaceAll(" ","%20");
  16. columnName = columnName.replaceAll(" ","%20");
  17. allDatas = list();
  18. params = Map();
  19. params.put("column_names",columnName);
  20. params.put("method","worksheet.records.fetch");
  21. params.put("worksheet_id",sheetName + "#");
  22. sheetDetails = invokeurl
  23. [
  24. url :"https://sheet.zoho"+environment.get("tld")+"/api/v2/" + spreadSheetId
  25. type :GET
  26. parameters:params
  27. connection:"addbulkusers"
  28. ];
  29. info sheetDetails;
  30. if(sheetDetails.get("status") == "success" && sheetDetails.get("records").size() <= 1000)
  31. {
  32. allDatas.addAll(sheetDetails.get("records"));
  33. }
  34. else if(sheetDetails.get("status") == "success" && sheetDetails.get("records").size() > 1000)
  35. {
  36. return {"type":"form_error","text":"I can only able to add 1000 user. Kindly try passing with 1000 records in the sheet!!!"};
  37. }
  38. else
  39. {
  40. return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
  41. }
  42. info "allData: " + allDatas.size();
  43. if(allDatas.size() > 1000)
  44. {
  45. return {"type":"form_error","text":"I can only able to add 1000 user. Kindly try passing with 1000 records in the sheet!!!"};
  46. }
  47. for each  data in allDatas
  48. {
  49. if(data.get(formValues.get("headername")) == null)
  50. {
  51. return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
  52. }
  53. emailIdList.add(data.get(formValues.get("headername")));
  54. if(emailIdList.size() == 100)
  55. {
  56. channelID = formValues.get("channels").get("id");
  57. params = {"email_ids":emailIdList};
  58. info "Params: " + params;
  59. addUsers = invokeurl
  60. [
  61. url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
  62. type :POST
  63. parameters:params.toString()
  64. detailed:true
  65. connection:"addbulkusers"
  66. ];
  67. info "Adduser: " + addUsers;
  68. if(addUsers.get("responseCode") == "204")
  69. {
  70. successlist.addAll(emailIdList);
  71. }
  72. else
  73. {
  74. failedlist.addAll(emailIdList);
  75. }
  76. info "100: " + emailIdList.size();
  77. emailIdList = list();
  78. }
  79. }
  80. if(emailIdList.size() > 0)
  81. {
  82. channelID = formValues.get("channels").get("id");
  83. params = {"email_ids":emailIdList};
  84. info "Params: " + params;
  85. addUsers = invokeurl
  86. [
  87. url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
  88. type :POST
  89. parameters:params.toString()
  90. detailed:true
  91. connection:"addbulkusers"
  92. ];
  93. info "Adduser: " + addUsers;
  94. if(addUsers.get("responseCode") == "204")
  95. {
  96. successlist.addAll(emailIdList);
  97. }
  98. else
  99. {
  100. failedlist.addAll(emailIdList);
  101. }
  102. info "Email id: " + emailIdList;
  103. }
  104. info "Successlist: " + successlist;
  105. info "Failedlist: " + failedlist;
  106. if(successlist.size() > 0 && failedlist.size() > 0)
  107. {
  108. postMessage = {"text":"Successfully added " + successlist.size() + " member(s) and failed for " + failedlist.size() + " Member(s)"};
  109. }
  110. else if(successlist.size() > 0 && !failedlist.size() > 0)
  111. {
  112. postMessage = {"text":"Successfully added " + successlist.size() + " member(s)"};
  113. }
  114. else if(!successlist.size() > 0 && failedlist.size() > 0)
  115. {
  116. postMessage = {"text":"Adding members in channel failed for " + failedlist.size() + " member(s)"};
  117. }
  118. info zoho.cliq.postToChat(chat.get("id"),postMessage);
  119. }
  120. else
  121. {
  122. csvFile = formValues.get("csvFile");
  123. csvFile = csvFile.getfilecontent();
  124. allDatas = csvFile.toList("\n");
  125. i = 0;
  126. indexValue = 0;
  127. indexBoolean = false;
  128. for each  data in allDatas
  129. {
  130. if(i == 0)
  131. {
  132. headers = data.toList(",");
  133. for each  header in headers
  134. {
  135. info header;
  136. if(headerName == header)
  137. {
  138. indexBoolean = true;
  139. indexValue = headers.indexOf(headerName);
  140. }
  141. }
  142. if(indexBoolean == false)
  143. {
  144. return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
  145. }
  146. }
  147. else 
  148.             {
  149. emailIdList.add(data.get(indexValue));
  150.             }
  151. i = i + 1;
  152. if(emailIdList.size() == 100)
  153. {
  154. channelID = formValues.get("channels").get("id");
  155. params = {"email_ids":emailIdList};
  156. info "Params: " + params;
  157. addUsers = invokeurl
  158. [
  159. url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
  160. type :POST
  161. parameters:params.toString()
  162. detailed:true
  163. connection:"addbulkusers"
  164. ];
  165. info "Adduser: " + addUsers;
  166. if(addUsers.get("responseCode") == "204")
  167. {
  168. successlist.addAll(emailIdList);
  169. }
  170. else
  171. {
  172. failedlist.addAll(emailIdList);
  173. }
  174. info "100: " + emailIdList.size();
  175. emailIdList = list();
  176. }
  177. }
  178. if(emailIdList.size() > 0)
  179. {
  180. channelID = formValues.get("channels").get("id");
  181. params = {"email_ids":emailIdList};
  182. info "Params: " + params;
  183. addUsers = invokeurl
  184. [
  185. url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
  186. type :POST
  187. parameters:params.toString()
  188. detailed:true
  189. connection:"addbulkusers"
  190. ];
  191. info "Adduser: " + addUsers;
  192. if(addUsers.get("responseCode") == "204")
  193. {
  194. successlist.addAll(emailIdList);
  195. }
  196. else
  197. {
  198. failedlist.addAll(emailIdList);
  199. }
  200. }
  201. info "Successlist: " + successlist;
  202. info "Failedlist: " + failedlist;
  203. if(successlist.size() > 0 && failedlist.size() > 0)
  204. {
  205. postMessage = {"text":"Successfully added " + successlist.size() + " member(s) and failed for " + failedlist.size() + " Member(s)"};
  206. }
  207. else if(successlist.size() > 0 && !failedlist.size() > 0)
  208. {
  209. postMessage = {"text":"Successfully added " + successlist.size() + " member(s)"};
  210. }
  211. else if(!successlist.size() > 0 && failedlist.size() > 0)
  212. {
  213. postMessage = {"text":"Adding members in channel failed for " + failedlist.size() + " member(s)"};
  214. }
  215. info zoho.cliq.postToChat(chat.get("id"),postMessage);
  216. }
  217. }
  218. catch (e)
  219. {
  220. info e;
  221. return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
  222. }
  223. return Map();

Step 3  : Configuring form change handler

  • After copying and pasting the code into the form submission handler, navigate to the form change handler for the created form function.
  • You can find this in the top left corner of the editor, where you will see an arrow next to the form submission handler. Clicking on this arrow will display the form change handler in a dropdown menu.
  • Click it to edit the code in the form change handler, which is necessary for real-time modifications to a form's structure or behaviour based on user input in a specific field. 
  1. targetName = target.get("name");
  2. info targetName;
  3. inputValues = form.get("values");
  4. info inputValues;
  5. actions = list();
  6. if(targetName.containsIgnoreCase("import_Type"))
  7. {
  8. fieldValue = inputValues.get("import_Type").get("value");
  9. info fieldValue;
  10. if(fieldValue == "csv")
  11. {
  12. actions.add({"type":"add_after","name":"import_Type","input":{"label":"CSV File","name":"csvFile","placeholder":"Please upload a zCSV File","mandatory":true,"type":"file"}});
  13. actions.add({"type":"remove","name":"url"});
  14. }
  15. else if(fieldValue == "zohosheet")
  16. {
  17. actions.add({"type":"add_after","name":"import_Type","input":{"name":"url","label":"Enter the sheet url","placeholder":"https://sheet.zoho.com/sheet/open/6xhgb324f142e91d845e5b4b472f7422379c9","min_length":"0","max_length":"400","mandatory":true,"type":"text","format":"url"}});
  18. actions.add({"type":"remove","name":"csvFile"});
  19. }
  20. }
  21. return {"type":"form_modification","actions":actions};

Business use cases:

  • HR onboarding: Seamlessly add new employees to internal communication channels.
  • Event management: Quickly invite attendees to event-specific channels.
  • Education platforms: Enroll students in course groups in one go.
  • Community building: Grow large communities by importing member lists effortlessly.

Bottom line

Bulk user addition in Cliq channels through Zoho Sheet or CSV files allows us to eliminate tedious tasks, reduce errors, and manage large-scale data effortlessly. Is onboarding consuming too much of your valuable development time? If so, it might be time to shake things up with a customized workflow!

We're here to help, so don't hesitate to reach out to support@zohocliq.com with any questions or if you need assistance in crafting even more tailored workflows.

    • Sticky Posts

    • 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
    • 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
    • Unfurling Unlimited Possibilities in Zoho Cliq 🔗

      Are you tired of your app links looking plain? Imagine if the shared links came to life with custom previews, organized data, and one-click actions, making chats more interactive. With the Cliq platform's unfurl handlers, let's see how developers can
    • Let's build a dashboard with Cliq Widgets!

      While juggling multiple tasks and tracking real-time data, you face a strict deadline for delivering a quarterly analysis report on a blank canvas while switching between different apps. Sounds exhausting, right? What if you could streamline everything
    • 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
    • Recent Topics

    • Bulk upload image option in Zoho Commerce

      I dont know if I am not looking into it properly but is there no option to bulk upload images along with the products? Like after you upload the products, I will have to upload images one by one again? Can someone help me out here? And what should I enter
    • 404 Error When Using record_cursor in ZOHO.CREATOR.DATA.getRecords (js api)

      Iam working on fetching all records from a Zoho Creator report using the Get Records API (V2.1) with the following recursive function: js CopyEdit // Recursive function to fetch records using record_cursor from the response function fetchAllRecords(recordCursor
    • Add haptic feedback when QR / barcode is scanned

      Hi, One of my user has a Creator App and scan QR codes. He suggests a haptic feedback is a great addition to validate that the QR code is effectively scanned and inserted in to the field. He is using an iPad for scanning. Thank you !
    • Input list of records in Lookup

      Salut, I have 2 scripts that input list of records in a lookup. The first on works fine, the second one doesn't and I do not know why. The only differences, is that the first one input in a lookup a list of records from an actual lookup field, and with
    • Are downloadable product available in Zoho Commerce

      Hi all. We're considering switching to Zoho Commerce for our shop, but we sell software and remote services. Is there a features for downloadable products? I can't find any information about this. Thank you very much Alice
    • Parent-Child Tickets using API or Deluge

      Hi Everyone, We are looking at the parent-child ticketing features in Zoho Desk. We want to be able to create a parent ticket at customer level and nest child tickets underneath. The issue we are facing is to be able to automate this. I'm checking the
    • In line code commenting in Deluge

      A request to enhance readability: currently you can add 'in line' comments for Deluge code, but after you save and reopen, the comments are moved down to the new line. i.e. info "test response"; //this is a info statement for a test response gets changed
    • Delete purchase order

      Buenos días, quisiera su ayuda para retirar los documentos adjuntos, ya que necesito iniciar sesión nuevamente para la venta de unos vehículos.
    • Zoho One Groups and Departments - how are they used ?

      I've seen that Zoho One has the ability to create Groups and Departments, however they don't seem to do anything ? There is no ability to pick up these same groups in ; Zoho Analytics, Zoho Forms, Zoho Vault for just starters . Why aren't the Zoho One
    • Insert Dates Into Subform

      Hi Everyone, Good evening. I've been looking for this all day, but can't find it. Is it possible to insert the entire date inputted from start date and end date into the subform? I also attached the image, to make it clearer. Jadwal Pertemuan = Start
    • Introducing Zoho CRM for Everyone: A reimagined UI, next-gen Ask Zia, timeline view, and more

      Hello Everyone, Your customers may not directly observe your processes or tools, but they can perceive the gaps, missed hand-offs, and frustration that negatively impact their experience. While it is possible to achieve a great customer experience by
    • Default Lookup Field Value based on Picklist

      How do I change a lookup field value based on another field's value, while creating/editing a record using form? I have a picklist of different types of Loans. For example: PPP, EDIL, Term, etc. When I create a record using the form, if I choose PPP from
    • How do I embed the webinar into a webpage?

      All I can seem to do is embed the signup form. This is cheesy. Surely they must have fixed this by now, right? How do I do it?
    • Automate Note Creation for Service Appointments

      Hi Latha, I hope you're doing great. Thank you for your continued support in helping resolve previous issues — it's truly appreciated. I'm currently working on automating another workflow using Deluge in the Service_Appointment module. Specifically, I
    • Date & Time Field | Minimum 24 hour notice.

      I'm trying to use Zoho Forms to build a booking request form. I have the date and time field selected as the field users can select their booking time for. My issue is I need a minimum of 24 hour notice for each appointment. I have it sent to only future
    • I can't understand Quiet Mode

      I want to set my Zoho mail notifications to only show during set times. I only want to see my notification pop-ups from 9am-5pm Monday-Friday. Or, in another words, I don't want to receive pop-up notifications between the hours of 5pm and 9am and for
    • Add Desk Account comments using Flow

      The triggers and actions for Zoho Desk available in Flow are quite extensive, but I don't see anything related to Account-level Comments. There are actions to add comments to Tickets, Contacts, Tasks, and Topics, but nothing for Accounts. Am I missing
    • Add subform record on data import

      I have some data pulled from analytics. I also have a "Projects" form with an "Assignments" subform linked to the "Assignments" form (not a blank form). Now when I edit a Project record, I can add new assignments manually and it will add the records in
    • Forward, attach, or flag email to an open ticket.

      Hi, when resolving customer requests through tickets in Zoho Desk, it is very common to receive emails from suppliers or third parties in Zoho Mail accounts or email groups that are not registered in the system. Is there any way to forward these emails
    • Update Main Form Date with Most Recent Subform Submission Date

      Hello, I have a field in my main form (equipment info) with the "date of last equipment inspection". I have a subform (equipment inspection) That wheen submitted for a piece of equipment I would like the submission date of the subform (equipment inspection)
    • Need Help with MX Record Verification

      Dear Zoho Mail Support Team, I’m setting up Zoho Mail for my domain "nexiumdynamics.com" and have already added the MX, SPF, and DKIM records as instructed. The domain DNS is managed through Odoo. However, the MX record verification on Zoho Mail is still
    • ¡Participa en los Zoholics Awards 2025!

      ¿Tu organización utiliza el software de Zoho de una forma innovadora? ¿Has logrado resultados dignos de noticia con nuestras aplicaciones? ¿O tienes un caso de uso especial de Zoho que te gustaría compartir con el mundo? Si es así, ¡este es tu momento
    • To be able to create a report sub folder

      Hello Can we request the ability to create subfolders in report folders.
    • Email Stuck in "Retry Queue" – Host Not Reachable

      Hello everyone, I’ve been encountering an issue when trying to send emails. Although the email appears in my Sent folder, it doesn’t reach the recipient, and I see the following status: In Retry Queue Temporary failure when delivering email to the recipients.
    • Identify, Qualify and Retarget Potential Leads Using Zoho SalesIQ & Campaigns

      Finding the right leads can often feel like guesswork. Because not all your website visitors are worth targeting — some may just be browsing, while others may have landed in there by accident. So how do you filter out the noise and focus on those who
    • Company with ZohoOne, notebook ask to upgrade to collaborate in notecards.

      Hello, we as a company have ZohoOne as our Zoho choice, but Zoho Notebook asks us to upgrade in order to collaborate in notecards, is this correct? Acording to what I've read in Zoho Notebook help, it should be included in ZohoOne, can you please clarify
    • Don't Receive Email

      Hi, I would like to report a problem . One of registered email in my organization is info@kedata.id . that email is used to register into MongoDB atlas. But for that case, i have a problem which the email of verification code from MongoDB atlas haven't
    • Possible to reorder Pipelines position?

      I have multiple Pipelines and want to reorder their positions, so that in the Deals module record for the Pipeline field, I have them ordered in a certain way. Is there a way to reorder the position of the Pipelines without deleting existing Pipelines
    • Laravel - Failed to authenticate on SMTP server

      For some reason, I cant send e-mails from my Laravel app Error: Failed to authenticate on SMTP server with username "myuser" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code
    • Custom View Row Limit?

      Is there a way to view more than 5 rows on a "Custom View" component on a user's homepage? I didn't see an option when creating or editing it. I'd like to be able to show the users 10 tasks at a time if possible.
    • Kaizen #63 - Layout Rules in Zoho CRM

      Hello and welcome to another week of Kaizen! This week, we will be discussing Layout Rules in Zoho CRM. If you need to modify the layout of a module based on user inputs, or to show or hide sections based on the value of a specific field, we have got
    • Can Zoho CRM JS SDK Send Notifications, Create Tasks & Calendar Events?

      Hello everyone! I’m just starting to explore this topic, so please excuse my beginner-level questions! Is it possible to use the JS SDK (https://help.zwidgets.com/help/latest/index.html) to: Send messages (signals, notifications) to specific employees,
    • Unable to import canvas template to canvas forms

      I'm unable to import exported canvas template to canvas form, the canvas form not recognizing the template code plus the canvas import prompt title is (Create your own form page) instead of import, find the attached screenshot Please advise
    • Remote Control Functionality During Screen Sharing in Zoho Cliq

      Hello Zoho Cliq Team, We would like to request the addition of remote control functionality during screen sharing sessions in Zoho Cliq. Currently, while screen sharing in Cliq is very useful, it lacks the ability for another participant to take control
    • Power of Automation :: Automatically Approve/Reject the associated timelogs of Issues

      Hello Everyone, 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
    • Zoho Desk iOS and Android app update: Attachment restriction

      Hello, everyone! We are excited to introduce an option to restrict uploading certain attachment types on the Zoho Desk app. This feature allows you to specify the types of attachments are allowed to be uploaded and shared within the Zoho Desk. This can
    • Zoho CRM Outlook integration: no option showing up even after installation

      I followed the instructions on this page to install the add-in: https://help.zoho.com/portal/en/kb/crm/integrations/microsoft/ms-outlook-add-in-for-zoho-crm/articles/outlook-add-in-for-zoho-crm#Understanding_the_add-in But I don't see the options in Outlook
    • Portal URL Not Working?

      When I view my Company Profile, it shows my portal URL as being not created although it has been.  For example my profile shows the following:  https://meeting.zoho.com/a/..  The directory name that I chose is missing and it appears that I need to create a new Portal URL although one already exists for my organization. When I try to visit the URL that I previously created, I receive a "Page Not Found" error.
    • Improve user efficiency with Automated reminders

      When it comes to business, keeping up with the deliverables is imperative. Automated reminders help you just with that, allowing you to set up notifications that are automatically triggered to your workspace users to remind them about important updates,
    • Setup Outlook for domain email address fails

      I am trying to setup outlook for one of my domains email addresses and I am unable to add the account in Outlook I get "Operation could not be completed" errors. I am using the imap.zoho.com 993 for incoming and smtp.zoho.com 465 for outgoing email. I
    • Next Page