The constant ebb and flow of employee absences can disrupt projects and hinder productivity. With Zoho Cliq's leave alert automation, you can easily keep your team informed. Real-time notifications can be sent to team chats, ensuring that everyone stays connected.

This enhances communication and workflow management by making all team members aware of colleague absences, while minimizing miscommunication and potential scheduling conflicts.


Pre-requisites:  

Before beginning to script the code below, we must create a connection in Cliq with Zoho People. 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 People default connection with a unique name "getemployeeinfo" with the scope - ZOHOPEOPLE.leave.ALL and ZOHOPEOPLE.dashboard.ALL

ⓘ Document for reference : Connections in Cliq 

How to obtain the bot unique name?

 

To use the postToChannelAsBot deluge task, the bot's unique name is essential, and the bot must be a participant in the channel.
  1. Create a bot with channel participation settings enabled to allow users to add the bot to any channel, send messages, listen to messages, and auto-follow threads.
  2. Click on the bot to open its details on the right-hand side. Locate the bot's incoming endpoint, and find the unique name of the bot in the URL after /bots.


Example : If the API Endpoint is:  https://cliq.zoho.com/company/242424/api/v2/bots/leavealerts/message
The unique name of the bot is 'leavealerts'.
  1. Add the bot to the preferred channel of your choice where you want the alerts to be posted.
ⓘ Document for reference :  Adding participants to a channel

Implementation :

Setting up the Zoho Cliq Scheduler

  • Open Zoho Cliq, click your profile picture, select Bots & Tools, and navigate to Schedulers.

  • Under Schedulers, create a new scheduler with the recurring period set to weekly and choose the days from Monday to Friday.

  • Specify the time name, description, and time of execution according to your needs.

ⓘ Document for reference : Schedulers  



Sample Leave alerts script

After providing the scheduler details, click "Save and Edit Code" to add the script below.
  1. currentDate = zoho.currentdate;
  2. currentDateString = currentDate.toString("dd-MMM-yyyy");
  3. info currentDateString;
  4. note = "";
  5. isRestrictedHoliday = "false";
  6. try
  7. {
  8. holidayResponse = invokeurl
  9. [
  10. url :"https://people.zoho.com/people/api/leave/v2/holidays/get?shift=General&employee=1&from=" + currentDateString + "&to=" + currentDateString + "&dateFormat=dd-MMM-yyyy"
  11. type :GET
  12. connection:"getemployeeinfo"
  13. ];
  14. info holidayResponse;
  15. holidayResponse = holidayResponse.toMap();
  16. if(holidayResponse.containsKey("data"))
  17. {
  18. holidayResponseData = holidayResponse.get("data").toList();
  19. if(holidayResponseData.size() > 0)
  20. {
  21. currentDayStatus = holidayResponseData.get(0);
  22. isRestrictedHoliday = currentDayStatus.get("isRestrictedHoliday");
  23. if("true".endsWithIgnoreCase(isRestrictedHoliday))
  24. {
  25. name = currentDayStatus.get("Name");
  26. note = "\nOptional holiday - " + name;
  27. }
  28. }
  29. }
  30. }
  31. catch (ex)
  32. {
  33. exceptionString = "exception occurred during restricted holiday check:  " + ex.toString();
  34. info exceptionString;
  35. }
  36. response = invokeurl
  37. [
  38. url :"https://people.zoho.com/api/v2/leavetracker/leaves/records?from=" + currentDateString + "&to=" + currentDateString + "&dateFormat=dd-MMM-yyyy&approvalStatus=[APPROVED]"
  39. type :GET
  40. connection:"getemployeeinfo"
  41. ];
  42. //info response;
  43. members = response.get("records");
  44. leaveMembers = "";
  45. membersSize = 0;
  46. for each member in members
  47. {
  48. membersSize = membersSize + 1;
  49. leaveMembers = leaveMembers + "[" + member.get("Employee") + "](zohoid:" + member.get("ZUID") + ")\n";
  50. }
  51. info "leave members : " + leaveMembers;
  52. if(leaveMembers.length() > 0)
  53. {
  54. data = {"card":{"theme":"7","title":"Team mates on leave (" + membersSize + ")" + note,"thumbnail":"https://thesoftwarepro.com/wp-content/uploads/2019/12/outlook-out-of-office.jpg"},"text":leaveMembers.trim(),"bot":{"name":"Leave Alerts","image":"https://www.pngfind.com/pngs/m/220-2200933_portfolio-alert-bot-by-symphony-alert-bot-hd.png"}};
  55. info data;
  56. }
  57. else
  58. {
  59. data = {"card":{"theme":"7","title":"Team mates on leave 0" + note,"thumbnail":"https://thesoftwarepro.com/wp-content/uploads/2019/12/outlook-out-of-office.jpg"},"text":"All Present Today.","bot":{"name":"Leave Alerts","image":"https://www.pngfind.com/pngs/m/220-2200933_portfolio-alert-bot-by-symphony-alert-bot-hd.png"}};
  60. }
  61. zoho.cliq.postToChanneAsBotl("CHANNEL_UNIQUE_NAME","BOT_UNIQUE_NAME",data);

Customize and deploy

 

Utilizing the data received from the invoke URL task (i.e., leavetracker/leaves/records GET request), construct a leave report card with Cliq's message builder and post it in the preferred chat or channel.

 

How to obtain the channel unique name?

  1. Go to the channel where you want the alerts to be posted.

  2. Hover over the three dots in the top right corner of the channel and select "Channel Info."

  3. In the Channel Info menu, go to the "Connectors" section to find the Channel Unique Name.





Troubleshooting :

  • Ensure your Zoho People pricing plan includes access to employee leave details.  

  • Verify whether the necessary administrative permissions are granted. Limited access can result in "Permission Denied" errors.

Empower automated workflows and stay ahead of absences

Automating leave alerts in Zoho Cliq boosts efficiency by minimizing disruptions from employee absences. Teams can benefit from real-time leave updates, allowing them to adjust plans, reassign tasks, and maintain the continuity of the project schedule.

    • Sticky Posts

    • Automating leave alerts in Zoho Cliq

      The constant ebb and flow of employee absences can disrupt projects and hinder productivity. With Zoho Cliq's leave alert automation, you can easily keep your team informed. Real-time notifications can be sent to team chats, ensuring that everyone stays
    • 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
      • Recent Topics

      • Pull Price Book and Product info in a single report

        i want to be able to produce price books for my engineers. If i could produce a report with the retail price as an option that would be great. This seems to be an old issue to please what are the plans. Moderation Update (16th Feb 2024): The option to
      • Custom TaskList and Tasks creation based on project custom field

        Hello, I'm trying to configure Zoho Project for a specific use. I have created a custom multiselection field in project template and I would like to create one tasklist with multiple tasks in it depending on the multiselection field on each project. For
      • Zoho Creator to Zoho Books

        Hi, I use Zoho Creator and Zoho Books. I use Creator to produce and send invoices (for specific reasons) but want to create a corresponding invoice in Books. Has anyone done this and if so, how? I have the following documentation but can't make sense
      • Subform Zoho Form to Creator

        Hi, I would like to be able to retrieve the values of a Zoho Form subform to create an entry for each in Zoho Creator. To send from Form to Creator, I use Zoho Flow. I have a custom function, which should normally retrieve each field value then create
      • Multi Select Between Modules

        Hi, I'm not sure if this is possible, but I want to "import" or "mirror" the multi select options from one module to another. For example... I have Module "Clients" with a Multi Select Field of "Enrolled Services" I also have a Module "Services" with
      • Firebase Functions integration

        Hello Zoho Team, Please advise how I can configure SMTP in my account to facilitate Firebase-triggered email functions. Please note that I desire to send an email with a JSON object collected from Firebase Firestore and included in my mail to forward
      • Doesn't Catch Duplicate Accounts

        Zoho is very bad at catching duplicate accounts. If we have an account in Zoho, and we import the same account but with "Inc." or "LLC", it doesn't catch it, it just duplicates it. When importing from another app (like ZoomInfo) I set it to catch duplicates
      • email Signature from Contact page not working

        Hey guys, I just set up my signature for the email i integrated with ZOHO. It works when I'm using the email client but when I send an email from the contact or lead page it doesn't add the signature. problem on my end or ZOHO's? thanks for the help!
      • Create Quote does not show the "Product Description" entered as part of the Product setup.

        The product description created as part of the product setup page, does not show in the Create Quote module; The module allows for an additional description to be added but without access to the original stored description. By selecting the product from the "Product Name Lookup" pop-up, the "Product Description" part should be populated from the product record where the user is allowed to further modify it.
      • 554 5.2.3 MailPolicy violation Error, help?

        This message was created automatically by mail delivery software. A message that you sent could not be delivered to one or more of its recipients. 554 5.2.3 MailPolicy violation Error delivering to mailboxes I am not sure why i am getting this, please
      • New Customization options in the module builder: Quick Create and Detail view

        Hello everyone, We have introduced two new components to the module builder: Quick create and Detail view. The Quick Create Component It is a mini form used to create a record and associate it to the parent record from a lookup field. For example, if you have a Deals lookup in the Contacts module, then you can associate existing deals or create a deal and associate it with the contact. You can customize this Quick Create form by adding standard as well as custom fields. There is no limit to the number
      • Créer un second centre d'aide dans Desk

        Bonjour, je souhaiterai pouvoir créer un second centre d'aide dans Desk afin d'avoir un service complètement indépendant du premier. Le premier fonctionne bien, il est pour notre service client. Mais j'aimerai maintenant pouvoir créer un nouveau service
      • Client Script | Update - Introducing Subform Events and Actions

        Are you making the most of your subforms in Zoho CRM? Do you wish you could automate subform interactions and enhance user experience effortlessly? What if you had Client APIs and events specifically designed for subforms? We are thrilled to introduce
      • User Tips: Auto-Create Opportunity/Deal upon Quote Save (PART 1)

        Problem: We use quotes which convert to sales order but Users / Sales Reps do not create opportunities / deals and go straight to creating a quote. This leads to poor reporting. Implementing this solution improves reporting and makes it easier for users.
      • Email Campaigns overview page is missing SENT DATE and # people sent to!

        I would like to see the date the email campaign was sent, so I can understand and track when each email campaign was sent. Right now, unless you go to a contact who received a campaign, you cannot see when the campaign was sent (!!!!!!). So, if my boss
      • Create an event from mail

        From mail I can create a task but I cannot create an event.  What am I missing?
      • How to customize Check Out form, process & design

        Hi Just set up my first shop and changed the design quite a bit. Like it so far! However, did not manage to change either Design, nor Content, nor Process of the Check Out. Where can I change this? E.g. - change the font of the check out forms - change
      • How do I use Deluge to search a Ticket by its Account?

        Usecase: with Zoho Flow, my task is to filter Tickets in Zoho Desk based on a few criteria and then use that information to edit and invoice in Zoho Billing. To achieve that, I'm using the Deluge search API to get all tickets from each Account (our clients)
      • Leistungsdatum in Rechnungen (Zoho Books)

        Hallo, ist es irgendwie möglich den Leistungszeitraum in der Rechnung aufzuführen? Beste Grüße Aleks
      • Issue with bulk importing into commerce (updating existing products)

        Hello All, I'm struggling to bulk update my existing products within my shop. I have exported all the products and appended the image url (copied from another product within the file) and then important back into commerce. The file is accepted but flags
      • Option to Re-order from past orders

        Customers would like to place a repeat order with the business entity. Currently there is no option to support this and everytime the customer has to check out following the same process. Can a option be given to reorder from the past orders?
      • Coupons are not being accepted. (Saying expired)

        I am putting together a coupon for our company's store. When I went to test it, I received a notification that the coupon is expired. (the date range should be fine though) I've tested different options for the coupon along with one of my other colleagues
      • Issues with Agent Forwarding Card in Zobot

        I implemented an Agent Forwarding Card in a Zobot that I created. There are a few issues with the way the card functions in an actual chat. The way it is designed right now is not easy to use and is not intuitive. Here are a few of the issues I have with
      • Drop Shipping

        We have manufacturers drop ship all of the items in our ecommerce store. that means that each item needs to have its own unique zip code to acquire real time shipping rates from that zip code. and then the manufacturer of that item gets an automatic email
      • apple pay

        if a customer is accessing via an iphone etc and we are taking payments via stripe would they be able to use apple pay?
      • ZDC Hackathon 2024 Category-wise Winners !

        Zoho CRM Client Script Hey everyone! After rigorous evaluation by our 14 expert judges, we’re beyond excited to announce that two incredible teams have won the Zoho CRM Client Script – Product Category award for their outstanding innovations! Team 1:
      • is Zoho eCommerce dead?

        Hello, we have Zoho eCommerce in our Zoho One Suite. After a year's break, we took a look at Zoho eCommerce this week. Very little has been developed. The normal eCommerce 2023 standard features are missing. Ok, Zoho eCommerce cannot be compared with
      • Issue with Cart API Implementation - Products Not Being Added to Cart

        I am writing to report an issue I'm experiencing with the Cart API implementation. I have tried multiple approaches to add products to a customer's cart programmatically, but I'm encountering difficulties. API Request Approach I am making a POST request
      • Pre-orders at Zoho Commerce

        We plan to have regular producs that are avaliable for purchase now and we plan to have products that will be avaliable in 2-4 weeks. How we can take the pre-orders for these products? We need to take the money for the product now, but the delivery will
      • Zoho Desk Onboarding Assistance - How to do bulk taging

        Hi How to apply a particular tag to multiple tickets in one go.
      • Time Zone Sending in Marketing Automation

        Good day...can anyone share if they have been able to get sending via Time Zones to actually work? Our data is 99% perfect, with all the time zone criteria met, yet the results are completely off target when we try to use it. We've had varied results
      • wishlist

        I need to know where to find the wishlist function in Zoho Commerce
      • single user access to the CRM suits

        I am currently using Zoho CRM Plus, where the pricing for a single user is ₹3,500 INR, and it includes access to multiple applications. However, I would like to add an additional user but restrict their access to only two specific applications within
      • Zoho Commerce / Zoho Inventory Integration

        How can I remove products in my Zoho Commerce products section? I have a big list of products here that are linked to our Zoho Inventory and some are published on our site and some aren't, but I'm wondering how we can remove these products from this list
      • Pinterest's "Claim website" requirement

        Hi, I need to get Pinterest and my Zoho website to shake-hands. For this, Pinterest needs me to 'claim my website' by adding a piece of HTML code to the <head> section. But is this the same as "Header and footer" sections in the settings? If yes, then
      • Agents can manage the Tasks on the go, now with Zoho Desk mobile app

         Hello, Everyone!    We are elated to announce one of our most asked for features 'Tasks' in the Zoho Desk app.  Agents can now create and associate tasks with a ticket and the tasks will be listed within the corresponding tickets.   Steps to access the tasks from the app:    1. Go to a particular ticket in the app. 2. Click the Tasks icon in the 'Related Information' section.  3. List of all the tasks will be displayed.    Refer to the screenshots (Android & iOS) attached below for your better understanding:
      • Quickly delete items in email builder?

        When deleting items in the email builder, it requires two clicks: one to hit the trash icon on the item, and then another click to confirm the delete. Is there anyway to skip the confirm deletion? Some kind of hot key like the Command button on the mac
      • How to Customize the Member Portal Login Page?

        Hi everyone, I am currently using the default member portal login page for Zoho Commerce, but I feel it looks quite plain and doesn’t align well with my brand's style. I would like to make it more visually appealing, possibly by: Adding custom colors
      • Introducing WhatsApp Marketing with Zoho Marketing Automation

        Dear Marketers, In the world of marketing, personalizing engagements with customers is often exhaustive but—thanks to WhatsApp—not exactly mysterious. WhatsApp has evolved from a simple messaging platform to a sophisticated tool for sending out marketing
      • Separating Inventory for Online Shop and Other Customers in Zoho Commerce & Inventory

        Hello everyone, We are using Zoho Commerce and are facing a challenge in managing our stock for different types of customers. Specifically, we want to ensure that our online shop pulls stock only from a specific warehouse, while other customers (e.g.,
      • Next Page