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".

- inputs = List();
- 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"});
- 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"});
- 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"});
- 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.
- emailIdList = list();
- successlist = list();
- failedlist = list();
- try
- {
- info form;
- formValues = form.get("values");
- columnName = formValues.get("headername");
- headerName = formValues.get("headername");
- if(formValues.get("import_Type").get("value") == "zohosheet")
- {
- url = formValues.get("url");
- spreadSheetId = url.getPrefix("?").getSuffix("open/");
- sheetName = url.getSuffix("?").getPrefix("&").getSuffix("=");
- worksheetname = sheetName.replaceAll(" ","%20");
- columnName = columnName.replaceAll(" ","%20");
- allDatas = list();
- params = Map();
- params.put("column_names",columnName);
- params.put("method","worksheet.records.fetch");
- params.put("worksheet_id",sheetName + "#");
- sheetDetails = invokeurl
- [
- url :"https://sheet.zoho"+environment.get("tld")+"/api/v2/" + spreadSheetId
- type :GET
- parameters:params
- connection:"addbulkusers"
- ];
- info sheetDetails;
- if(sheetDetails.get("status") == "success" && sheetDetails.get("records").size() <= 1000)
- {
- allDatas.addAll(sheetDetails.get("records"));
- }
- else if(sheetDetails.get("status") == "success" && sheetDetails.get("records").size() > 1000)
- {
- return {"type":"form_error","text":"I can only able to add 1000 user. Kindly try passing with 1000 records in the sheet!!!"};
- }
- else
- {
- return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
- }
- info "allData: " + allDatas.size();
- if(allDatas.size() > 1000)
- {
- return {"type":"form_error","text":"I can only able to add 1000 user. Kindly try passing with 1000 records in the sheet!!!"};
- }
- for each data in allDatas
- {
- if(data.get(formValues.get("headername")) == null)
- {
- return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
- }
- emailIdList.add(data.get(formValues.get("headername")));
- if(emailIdList.size() == 100)
- {
- channelID = formValues.get("channels").get("id");
- params = {"email_ids":emailIdList};
- info "Params: " + params;
- addUsers = invokeurl
- [
- url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
- type :POST
- parameters:params.toString()
- detailed:true
- connection:"addbulkusers"
- ];
- info "Adduser: " + addUsers;
- if(addUsers.get("responseCode") == "204")
- {
- successlist.addAll(emailIdList);
- }
- else
- {
- failedlist.addAll(emailIdList);
- }
- info "100: " + emailIdList.size();
- emailIdList = list();
- }
- }
- if(emailIdList.size() > 0)
- {
- channelID = formValues.get("channels").get("id");
- params = {"email_ids":emailIdList};
- info "Params: " + params;
- addUsers = invokeurl
- [
- url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
- type :POST
- parameters:params.toString()
- detailed:true
- connection:"addbulkusers"
- ];
- info "Adduser: " + addUsers;
- if(addUsers.get("responseCode") == "204")
- {
- successlist.addAll(emailIdList);
- }
- else
- {
- failedlist.addAll(emailIdList);
- }
- info "Email id: " + emailIdList;
- }
- info "Successlist: " + successlist;
- info "Failedlist: " + failedlist;
- if(successlist.size() > 0 && failedlist.size() > 0)
- {
- postMessage = {"text":"Successfully added " + successlist.size() + " member(s) and failed for " + failedlist.size() + " Member(s)"};
- }
- else if(successlist.size() > 0 && !failedlist.size() > 0)
- {
- postMessage = {"text":"Successfully added " + successlist.size() + " member(s)"};
- }
- else if(!successlist.size() > 0 && failedlist.size() > 0)
- {
- postMessage = {"text":"Adding members in channel failed for " + failedlist.size() + " member(s)"};
- }
- info zoho.cliq.postToChat(chat.get("id"),postMessage);
- }
- else
- {
- csvFile = formValues.get("csvFile");
- csvFile = csvFile.getfilecontent();
- allDatas = csvFile.toList("\n");
- i = 0;
- indexValue = 0;
- indexBoolean = false;
- for each data in allDatas
- {
- if(i == 0)
- {
- headers = data.toList(",");
- for each header in headers
- {
- info header;
- if(headerName == header)
- {
- indexBoolean = true;
- indexValue = headers.indexOf(headerName);
- }
- }
- if(indexBoolean == false)
- {
- return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
- }
- }
- else
- {
- emailIdList.add(data.get(indexValue));
- }
- i = i + 1;
- if(emailIdList.size() == 100)
- {
- channelID = formValues.get("channels").get("id");
- params = {"email_ids":emailIdList};
- info "Params: " + params;
- addUsers = invokeurl
- [
- url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
- type :POST
- parameters:params.toString()
- detailed:true
- connection:"addbulkusers"
- ];
- info "Adduser: " + addUsers;
- if(addUsers.get("responseCode") == "204")
- {
- successlist.addAll(emailIdList);
- }
- else
- {
- failedlist.addAll(emailIdList);
- }
- info "100: " + emailIdList.size();
- emailIdList = list();
- }
- }
- if(emailIdList.size() > 0)
- {
- channelID = formValues.get("channels").get("id");
- params = {"email_ids":emailIdList};
- info "Params: " + params;
- addUsers = invokeurl
- [
- url :environment.get("base_url") + "/api/v2/channels/" + channelID + "/members"
- type :POST
- parameters:params.toString()
- detailed:true
- connection:"addbulkusers"
- ];
- info "Adduser: " + addUsers;
- if(addUsers.get("responseCode") == "204")
- {
- successlist.addAll(emailIdList);
- }
- else
- {
- failedlist.addAll(emailIdList);
- }
- }
- info "Successlist: " + successlist;
- info "Failedlist: " + failedlist;
- if(successlist.size() > 0 && failedlist.size() > 0)
- {
- postMessage = {"text":"Successfully added " + successlist.size() + " member(s) and failed for " + failedlist.size() + " Member(s)"};
- }
- else if(successlist.size() > 0 && !failedlist.size() > 0)
- {
- postMessage = {"text":"Successfully added " + successlist.size() + " member(s)"};
- }
- else if(!successlist.size() > 0 && failedlist.size() > 0)
- {
- postMessage = {"text":"Adding members in channel failed for " + failedlist.size() + " member(s)"};
- }
- info zoho.cliq.postToChat(chat.get("id"),postMessage);
- }
- }
- catch (e)
- {
- info e;
- return {"type":"form_error","text":"I can't find any email ids. Kindly re-check the column name and header row!!!"};
- }
- 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.
- targetName = target.get("name");
- info targetName;
- inputValues = form.get("values");
- info inputValues;
- actions = list();
- if(targetName.containsIgnoreCase("import_Type"))
- {
- fieldValue = inputValues.get("import_Type").get("value");
- info fieldValue;
- if(fieldValue == "csv")
- {
- actions.add({"type":"add_after","name":"import_Type","input":{"label":"CSV File","name":"csvFile","placeholder":"Please upload a zCSV File","mandatory":true,"type":"file"}});
- actions.add({"type":"remove","name":"url"});
- }
- else if(fieldValue == "zohosheet")
- {
- 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"}});
- actions.add({"type":"remove","name":"csvFile"});
- }
- }
- 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.
Recent Topics
Add a 'Log a Call' link to three dot icon in Canvas
Hi, There's a three dot element when creating a canvas called 'More'. I would like to modify this to add a link that says 'Log a Call' in order to quickly record the details of a cellphone call. I'd also like this to be a simple 'contact' selection and
Introducing AI-powered Assessments & Zoho's native LLM, Zia
We’ve shipped a cleaner, faster way to create assessments in Zoho Recruit. 🚀 Instead of manually building question banks or copying old templates, you can now generate ready-to-use assessments in just a few clicks, all tailored to the role you’re hiring
Ability to Reset Visitor Fields During an Active Chat Flow
Hello Zoho SalesIQ Team, We hope you are doing well. We would like to propose a feature enhancement to Zoho SalesIQ regarding the management of visitor fields within Zobot flows. Use Case: Our bot asks the visitor to provide information about a 3rd person
External ID in Zoho CRM
Hello everyone! We know that Zoho CRM allows you to integrate third-party apps and manipulate data through APIs. While you integrate a third-party application, you may want to store the third-party reference IDs in Zoho CRM's records. To meet this need
Some emails are not being delivered
I have this problem where some of my mail just seems to disappear. When I send it, it appears as sent with no mention of any problem, but my recipient never gets it, not even in the Spam folder. Same for receiving, I have a secondary e-mail address, and
New in Zoho Chat : Search for contacts, files, links & conversations with the all new powerful 'Smart Search' bar.
With the newly revamped 'Smart Search' bar in Zoho Chat, we have made your search for contacts, chats, files and links super quick and easy using Search Quantifiers. Search for a contact or specific conversations using quantifiers, such as, from: @user_name - to find chats or channel conversations received from a specific user. to: @user_name - to find chats or channel conversations sent to a specific user. in: #channel_name - to find a particular instance in a channel. in: #chat_name - to find
Template modifiactions
Hello, I am struggling with the templates in ZOHO Books. Especially with the placement of some items, like company address, ship to, bill to etc. For example: One item I like from template X (placement of ship to and bill to next to each other in the
Aggregating the First Value in the Group By of a dataset
Hi I am trying to get the following Aggregate Formula to work in my chart, but cannot seem to get the right format. I have a series of data that I am running an include_groupby and want to SUM only a column in the first row of each group. So for example.
Admin Control Over Profile Picture Visibility in Zoho One
Hello Zoho Team, We hope you are doing well. Currently, as per Zoho’s design, each user can manage the visibility of their profile picture from their own Zoho Accounts page: accounts.zoho.com → Personal Information → Profile Picture → Profile Picture
Track Zoho Campaign and Workflow sales impact
I am attempting to measure the performance of our marketing workflows and campaigns by comparing the date each campaign was sent to a contact with the purchase date of the contact. For example, if Contact A was sent Email A on 9/1 and made a purchase
Tables for Europe Datacenter customers?
It's been over a year now for the launch of Zoho Tables - and still not available für EU DC customers. When will it be available?
What is a line break code for zoho?
Hi, I am archiving data by adding values from a single line field from one form to a multi-line field in another form. So I need a code/function that starts a new line on that multi-line field so it does not just keep adding it on the same line. Example, doing something like this means that it will be on a same line. archive.field1 = archive.field1 + input.Field1 I need a code so the input.Field1 can just start on the next line. Instead of "value 1, 2,3,4,5" It will be: "1 2 3 4 etc.". something
Automatic Project Owner change
Is there a way to change Project Owner automatically once a specific Milestone in a project is marked as completed. Different Teams are working on projects in our Org, they have their own Milestones to complete and so we transfer the project from team
Button to add product to cart
Is there a way to have a button on a page, that when clicked, will add Qty 1 of a product to the cart?
Problem with Submit Button Design
I have made a template to apply to my forms and under the button controls, I have it set to "standard" and yet it's still filling the container. This is super frustrating and looks weird. Why do we not have full control over button size? How can I fix
Zoho CRM- Authorize your Microsoft Teams account issue
Hi, I tried to link Zoho CRM with Teams and I got the following message: Clicking "Authorize now" sent me to the following page, Microsoft tried to start a session but, after 3 seconds the page closed and nothing happened. I get the same message each
Passing the CRM
Hi, I am hoping someone can help. I have a zoho form that has a CRM lookup field. I was hoping to send this to my publicly to clients via a text message and the form then attaches the signed form back to the custom module. This work absolutely fine when
Is there a way to associate an email in ZOHO Main to a Vendor record in ZOHO CRM
My situation is as below, I have a vendor in ZOHO CRM lets say "Vend A" and an associated contact, "Cont A" If Cont A sends me an email using the email I've registered in the contact record the standard OOTB email sync will work. But the vendor has some
Bank charges are applied. Please select a bank account.
Hello, I'm trying to add bank charges to a customer payment, but I get the error message "Bank charges are applied. Please select a bank account." I found this old thread, where it says that I need to "select a Bank account for the 'Deposit To' dropdown
Kaizen #207 - Answering your Questions | Advanced Queries using COQL API
Hi everyone, and welcome to another Kaizen week! As part of Kaizen #200 milestone, many of you shared topics you would like us to cover, and we have been addressing them one by one over the past few weeks. Today, we are picking up one of those requests
Présentation de SecureForms dans Zoho Vault
Soyons francs : demander à quelqu’un de transmettre un mot de passe ou des informations sensibles n’est jamais une tâche facile. On attend, on relance, parfois de nombreuses fois. Et quand l’information arrive, elle se retrouve souvent dispersée dans
Introducing Connected Records to bring business context to every aspect of your work in Zoho CRM for Everyone
Hello Everyone, We are excited to unveil phase one of a powerful enhancement to CRM for Everyone - Connected Records, available only in CRM's Nextgen UI. With CRM for Everyone, businesses can onboard all customer-facing teams onto the CRM platform to
Granular Email Forwarding Controls in Zoho Mail (Admin Console and Zoho One)
Hello Zoho Mail Team, How are you? At present, the Zoho Mail Admin Console allows administrators to configure email forwarding for an entire mailbox, forwarding all incoming emails to another address. This is helpful for delegation or backup purposes,
Sales order & purchase order item links for item details
This is fantastic for checking lots of things, I use it a lot. It would be great to see it extended to invoices & bills On another note, may as well throw in my favourite whinge ..... Wish you guys would get the PO receive differences sorted urgently,
Custom Fonts in Zoho CRM Template Builder
Hi, I am currently creating a new template for our quotes using the Zoho CRM template builder. However, I noticed that there is no option to add custom fonts to the template builder. It would greatly enhance the flexibility and branding capabilities if
Zoho Workdrive - Communication / Chat Bar
Hi Team, Please consider adding an option to allow admins to turn on or off the Zoho Communication Bar. Example of what I mean by Communication Bar: It's such a pain sometimes when I'm in WorkDrive and I want to share a link to a file with a colleague
Introducing Profile Summary: Faster Candidate Insights with Zia
We’re excited to launch Profile Summary, a powerful new feature in Zoho Recruit that transforms how you review candidate profiles. What used to take minutes of resume scanning can now be assessed in seconds—thanks to Zia. A Quick Example Say you’re hiring
Kaizen #190 - Queries in Custom Related Lists
Hello everyone! Welcome back to another week of Kaizen! This week, we will discuss yet another interesting enhancement to Queries. As you all know, Queries allow you to dynamically retrieve data from CRM as well as third-party services directly within
Need the ability to have read only fields on a form.
There needs to be functionality in Creator that allows a field on a form to be read only. Most screen building software applications have this capability. I know you can hide certain fields from specific users and that you can also make the whole form read only but that's not the functionality I need. I want to be able to create a form where certain fields are editable and other are for display purposes only (read only). For example if the form was displaying information on an item that the user
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?
New integration: Track booking page appointments in Google Analytics 4
Hello all, Greetings from the Zoho Bookings team! We’re excited to introduce our new Google Analytics 4 (GA4) integration designed to help you track booking activity, understand customer behavior, and measure marketing performance, all in one place. What
Zoho Books Sandbox environment
Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
How to list emails in a folder, e.g. Inbox, on multiple pages when using Zoho mail webpage?
Something as shown in the figure. There are totally 50 emails in Sent folder. If "Mail per page" equals 20, then the Sent folder is split into 3 pages. When I wander through Sent folder, I can just select a specific page to jump to. BTW, it seems that
How to add image to items list in Invoice or Estimate?
Hello! I have just started using Zoho Invoice to create estimates and, possibly to switch from our current CRM/ERP Vendor to Zoho. I have a small company that is installing CCTV systems and Alarm systems. My question is, can I add images of my "items" to item list in Zoho Invoice and Estimates and their description? I would like to show my clients the image of items in our estimates so they can decide if they like these items. And I tell you, often they choose more expensive products just because
Zoho Calendar soft bounce on @hotmail.com and @yahoo.com email addresses
Hello, our Zoho calendar recently does not send the calendar invites to emails with hotmail and yahoo domains and comes back with a "soft bounce". other domains like Gmail works fine. Also sending "email" to the same emails to the above domains work well
How can I filter a field integration?
Hi, I have a field integration from CRM "Products" in a form, and I have three product Categories in CRM. I only need to see Products of a category. Thanks for you answers.
ERROR CODE :512 - 5.4.4 DNS error:NXDOMAIN.
Suddenly we cant send mail, we are getting this error for all outbound mail to multiple domains.
Can Zoho Flows repeat Actions more than once?
I'm attempting to make an intentional Zoho Flow loop using the below layout. However, when "WithinLimit" condition is met, the program fails to execute the action "Get & Add Request Co..." again. Is this by design? Is Zoho Flows unable to repeat actions
Unveiling Cadences: Redefining CRM interactions with automated sequential follow-ups
Last modified on 01/04/2024: Cadences is now available for all Zoho CRM users in all data centres (DCs). Note that it was previously an early access feature, available only upon request, and was also known as Cadences Studio. As of April 1, 2024, it's
customer data security
We are exploring ways to enhance our within Zoho CRM. Our Goal: We want to fully integrate RingCentral with Zoho CRM to enable click-to-call functionality for our sales team. However, to comply with data privacy regulations and protect customer contact
Next Page