Using Cliq forms to add a task in Projects
Forms in Cliq are platform components that can take in multiple user inputs in a single go, standardize the way work gets kicked off in an organization and helps you automate your everyday workflow.
Let's understand forms better by considering the following scenario.
Scenario
Assume, your team is now working on a new project and your lead decides to assign the tasks to the concerned person in Zoho Projects. As a first step, let's connect Zoho Projects with Cliq and add tasks right from the Cliq window using forms. To do this,
1. Connect Cliq with Zoho Projects by giving your connection a name followed by specifying the scopes.
2. The scopes required to add a task in Zoho Projects are,
- ZohoProjects.portals.READ
- ZohoProjects.projects.READ
- ZohoProjects.users.READ
- ZohoProjects.tasks.CREATE
3. The required method is POST and the URL to connect Zoho Projects with Cliq is
4. Once after you initiate the connection use the deluge code generated, in your script.
5. To know more about the scopes available in Zoho Projects head on over
here.
The bots menu handler and form submit handler code to add a task in Zoho Projects is attached here. Try copying the code in your deluge editor and execute it.
Bot menu handler code
- response = Map();
- inputs = list();
- inputs.add({"type":"text","name":"taskname","label":"Task Name","placeholder":"Specify the task name","mandatory":true,"value":"Enter the task name here"});
- inputs.add({"type":"textarea","name":"desc","label":"Add Description","placeholder":"A small description of the task","mandatory":false,"value":"A small description about the task"});
- inputs.add({"type":"date","name":"startdateinfo","label":"Start Date","placeholder":"01-01-2020","mandatory":false});
- inputs.add({"type":"date","name":"duedateinfo","label":"Due Date","placeholder":"01-01-2020","mandatory":false});
- inputs.add({"type":"select","name":"prior","label":"Priority","placeholder":"None","mandatory":false,"value":"None","options":[{"label":"None","value":"none"},{"label":"High","value":"high"},{"label":"Medium","value":"medium"},{"label":"Low","value":"low"}]});
- por = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portals/"
- type :GET
- connection:"Your connection name"
- ];
- portals = por.get("portals");
- user_listing=Collection();
- for each portal in portals
- {
- id = portal.get("id_string");
- pro = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portal/" + id + "/projects/"
- type :GET
- connection:"Your connection name"
- ];
- projects = pro.get("projects");
- for each project in projects
- {
- pid = project.get("id_string");
- users = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portal/"+id+"/projects/"+pid+"/users/"
- type : GET
- connection:"Your connection name"
- ];
- for each user in users.get("users")
- {
- user_id=user.get("id");
- user_name=user.get("name");
- user_listing.insert({"label":user_name,"value":user_id});
- }
- }
- }
- inputs.add({"type":"select","max_selections":"2","multiple":true,"name":"assignee","label":"Owner","placeholder":"Add a user","mandatory":true,"value":"Olivia","options":user_listing});
- form = {"type":"form","title":"New Task","hint":"Add a new task in Projects","name":"addtasks","version":1,"button_label":"Add","action":{"type":"invoke.function","name":"tasks"},"inputs":inputs};
- return form;
Form submit handler code
- response = Map();
- param = Map();
- formValues = form.get("values");
- priority = formValues.get("priority");
- param.put("name",formValues.get("taskname"));
- param.put("description",formValues.get("desc"));
- param.put("start_date",formValues.get("startdateinfo").toString("MM-dd-yyyy"));
- param.put("end_date",formValues.get("duedateinfo").toString("MM-dd-yyyy"));
- param.put("priority",formValues.get("prior").get("label"));
- param.put("person_responsible",(formValues.get("assignee").get("0").get("value")).toString());
- por = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portals/"
- type :GET
- connection:"Your connection name"
- ];
- portals = por.get("portals");
- for each portal in portals
- {
- id = portal.get("id_string");
- pro = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portal/" + id + "/projects/"
- type :GET
- connection:"Your connection name"
- ];
- user_listing_map = Map();
- projects = pro.get("projects");
- for each project in projects
- {
- pid = project.get("id_string");
- tasks = invokeurl
- [
- url :"https://projectsapi.zoho.com/restapi/portal/" + id + "/projects/" + pid + "/tasks/"
- type :POST
- parameters:param
- connection:"Your connection name"
- ];
- }
- }
- return {"text":"Hurray! Successfully added a task in Projects :happy:"};
With a multitude of possibilities available with forms, Zoho Cliq let's you build dynamic forms using a form builder. A form builder in Cliq is a form building platform for non coders to build interactive forms easily.
Here's a small video on building a form using the form builder.
There you go! A small example to understand how forms can come in handy to get your works done on the go. In case of any doubts or queries, do comment below. We'd be happy to assist you.
Regards,
Divya P
Zoho Cliq
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Sticky Posts
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
The Slash Command Series - Types of Command Suggestions
Hi Everybody! I hope you guys tried the /zdocs command and now have an idea of how command suggestions with click to execute work. If you have no clue of what command suggestion is, I recommend you to take a look at all the Slash Command Series posts, especially the one on Command Suggestions ! This post is all about the different types of command suggestions. Customise your command suggestions Did you know you could customise your command suggestion list with a title, description, image? Well,
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.