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 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
      • Accelerate Github code reviews with Zoho Cliq Platform's link handlers

        Code reviews are critical, and they can get buried in conversations or lost when using multiple tools. With the Cliq Platform's link handlers, let's transform shared Github pull request links into interactive, real-time code reviews on channels. Share
      • App Spotlight : PagerDuty for Zoho Cliq

        App Spotlight brings you hand-picked apps to enhance the power of your Zoho apps and tools. Visit the Zoho Marketplace to explore all of our apps, integrations, and extensions. In today's fast-paced world, seizing every moment is essential for operational
      • Automate your status with Cliq Schedulers

        Imagine enjoying your favorite homemade meal during a peaceful lunch break, when suddenly there's a PING! A notification pops up and ruins your moment of zen. Even worse, you might be in a vital product development sprint, only to be derailed by a "quick
      • 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

        • Recent Topics

        • Profile Image Showing Incorrectly in Zoho Mail

          Hi everyone, I’m facing a serious issue with Zoho Mail. The profile image showing for my email address is incorrect — it’s not my image. When I send an email to my Gmail account, it displays someone else’s image. This looks very suspicious and can make
        • I need access to my old email

          I need access to my old email bromzeman@zoho.com to verify it for forwarding. I can’t access the inbox to get the confirmation code. Please assist with recovery or forwarding. as you might already know, they made alot of the email addresses to have that
        • Set Defaults for Email Groups

          Is there a way to set defaults for all of the groups that I establish as a moderator? For example, I want every group I establish to have the following settings: 1. Moderator is <user> 2. User is <user>, <user> 3. Notifications for new group turned
        • LOGS FOR RECEIVED MAIL ( READ DATE & TIME)

          In Zoho mail we can extract the read logs of received mails so that we can see when we have read the mail and at what time & we have read it.
        • Domain verification probem

          Hello, i use a domain from Namecheap with hosting from Cinfu when i try to verify my domain on zoho i get "TXT Verification failure" i even tried the HTML verification and the code appears but also giving me the verification failure error.
        • Switching to Cloudflare email routing from Zoho Mail

          Hello, I'm currently working on migrating from Zoho Mail to Cloudflare's email routing solution. This requires changing MX and TXT records for our custom domain - when we do this, will our users still be able to log into their accounts and access an archived
        • Un Subscription Button

          How can i Add the Un Subscription Button in Zoho mail
        • Documents unable view and need to downlad

          I can't view .doc files in Zoho mail unless I download them, but I can view PDF files without downloading.
        • we encountered a problem while sending your email. please try again later.

        • Adding and removing people from groups

          We're having problems adding people to a group. Apparently Zoho has one email address and will not recognize a different email address.
        • MAIL SEARCH IS NOT WORKING

          THIS ISSUE HAS BEEN BUGGING ME SINCE MORNING, PLEASE RESOLVE THIS AT THE EARLIEST
        • URL Parameter on Help Center SIgn in link

          Is it possible to add a url parameter to the sign in link on the Help Center?
        • migrating from HelpScout

          I am attempting to import a conversation file from helpscout into desk and am receiving size errors. What is the current file size restriction. Does anyone have any tips for a successful migration?
        • Layout Rules Don't Apply To Blueprints

          Hi Zoho the conditional layout rules for fields and making fields required don't work well with with Blueprints if those same fields are called DURING a Blueprint. Example. I have field A that is used in layout rule. If value of field A is "1" it is supposed to show and make required field B. If the value to field A is "2" it is supposed to show and make required field C. Now I have a Blueprint that says when last stage moves to "Closed," during the transition, the agent must fill out field A. Now
        • Article Name Sorting in Zoho Desk Knowledge Base (agent / admin side)

          Dear Zoho Desk Support, We are writing to request an enhancement to the Knowledge Base management feature within Zoho Desk. Currently, there is no option to sort articles by their name, which significantly hinders efficient article management, especially
        • How to parse JSON data with SQL in Zoho Analytics?

          Hi all, I have a column with JSON data. I want to show this column in a chart, but it is very messy, and no JSON parsing function is supported on Zoho Analytics. data example: {"id": 5, "status": "false", "date": "15/10/22"} what I want to do in SQL is
        • Ability to turn off "Would you like this amount to be reflected in the Payment field?" message

          Team, Is there any way to turn off the message" Would you like this amount to be reflected in the Payment field?" when I make a payment? This is so annoying. This happens EVERY TIME I put an amount in the Payment Made field.
        • Add an Equation Field (Or update the Formula Field)

          Hi, I would like to be able to have one field as a Text Field with QR Code, and then have multiple Equation/Formula Fields that then take parts of that fields data with LEFT, MID, RIGHT, REGEX, etc. Thanks Dan
        • How to parse column having JSON data using SQL?

          We have a daily sync from a PostgreSQL database that brings data into Zoho Analytics. Some of the columns store raw JSON data. We need to build SQL queries on top to parse data from JSON and store them in discrete columns. There is no option for "Data
        • Enable report button based on the current user role

          Greetings  i have a report that contains action buttons, i want these buttons to appear as enabled only when the current logged in user has a certain role, for example only CEO role users will be able to use this button. but when setting the conditions
        • 500 Internal Error In Mail API

          I'm getting 500 Internal Error when using mail API. I'm getting this error for this one account, it works fine for other Account IDs which I have in my system.
        • Piss poor service in Support in Domains and email

          Srijith Narayanan B contacted me today. Very pleasant fellow. Just didn't want to tell him how bad your support service is. You help the person, but you leave before we can finish the next stage. Which causes a lot of frustration. It's been 8 days now
        • Zoho live chat widget in React Js

          I am trying to test Zoho live chat widget code in react js, below is the sample code void(0)} onClick={()=>window.$zoho.salesiq.floatwindow.visible("show")}>LIVE CHAT window.$zoho = window.$zoho || {};window.$zoho.salesiq = window.$zoho.salesiq
        • Are there any plans to add Triggers for Subform edits?

          By The Grace of G-D.  Hi, How are you? Can you tell me if you have any plans to support subform edit as a workflow trigger? And what about have them trigger an "onChange" client script?
        • Zoho commerce

          i am facing issue with order summary emails.i am getting 1 continuous email for order received yesterday and today.ideally 1 email should be received for a particular date ie for 02/08 i should received 1 email from 12.01am till 11.59pm but it is being
        • Feature Request: Improve Category Page Sorting for "Out of Stock" Products

          Hi there, I'm writing to request a new feature that I believe would significantly improve the user experience in my online store. Currently, on category pages, products are sorted by popularity. However, when a popular product goes "Out of Stock," it
        • POSTMAN - There was an error in evaluating the Pre-request Script:Error: Cannot read properties of undefined (reading 'json')

          I am beginning the journey to learn how to use the API for Zoho Sign. I am getting the following error when I try to use postman. To walk you through how I am getting this error... I wanted to start with a simple GET and expand my learning from there.
        • How do i integrate shipstation with zoho inventory

          Wanting to set up my own delivery driver in ship station so we can get real time tracking of where the package is but then i want it to automatically update zoho inventory packages/shipments how can i do this
        • Invalid value passed for salesorder_id

          Hi, I am using sales return API, details are given below: API: https://inventory.zoho.com/api/v1/salesreturns?organization_id=700571811 Post Json Data: { "salesreturn_number": "", "date": "2020-11-12", "reason": "Testing from API", "line_items": [ { "item_id":
        • Create Invoice and Invoice Items from Sales Order via API

          Currently, when creating an Invoice associated with a Sales Order via the API, it appears that I must manually include all of the items (line_items) even though they are already part of the Sales Order. My question is this: is it possible to raise an Invoice via the API based on all of the information associated with a Sales Order--such as the  items? In other words, do I always have to manually include the items (line_items) when raising an Invoice via the API when the Invoice is associated with
        • Outlook 2013 Calendar Syncs but "Related To" Field in Zoho is blank

          Outlook 2013 Calendar Syncs but Related To Field in Zoho is blank I expect the "Realted To" field to be populated with the calendar participants
        • Export a Course

          Is it possible to export a course from Zoho Learn to a SCORM file?
        • Add and Remove Agents from Departments and Groups in Zoho One

          Hi Zoho Flow Team, We hope you're doing well. Currently, Zoho Flow provides an action to add an agent to a group in zoho one, but there is no action to remove an agent from a group or a department. Another action that we find missing is the option to
        • Zoho learn Custom portal - networkurl & CustomPortalId

          I want to get my individual account’s networkurl and customportalId to use in this API: https://learn.zoho.com/learn/api/v1/portal/<networkurl>/customportal/<customportalId>/manual How can I retrieve the networkurl and customportalId using the API? I
        • Consumer Financing

          Does Zoho currently have a payment gateway (such as Stripe, Square, etc) which offers financing for customers? So, let's say the estimate we give the customer is greater than what they can afford at the time, but we can sell the service now, letting them
        • Intégration de la gestion des Passkeys dans Zoho Vault

          Zoho Vault est depuis plus d’une décennie une solution fiable pour les entreprises : pour la gestion, le partage et le stockage des mots de passe. En 2018, nous avons fait un pas en avant en proposant la connexion unique (SSO). Nous sommes fiers de franchir
        • Scan & Fill with double quote key/value pairs

          Hi, An old Ticket moved to a Topic/Idea: I love the idea of the new Scan & Fill as it nearly covers my previous request for a QR Scanner to read a multi-part QR Code. My QR Codes are hard-coded as below: {"key1":"value1","key2":"value2","key3":"value3"}
        • Analytics SQL Queries should allow # as comment

          # and // are very common for commenting in SQL. Not sure why analytics only allows /* and */ for commenting. Especially when # grays the line as if it's being commented out. This should be added for sure.
        • SalesIQ Operator Activity Reports in Zoho Analytics

          I'm busy building a dashboard in Zoho Analytics and I want to include SalesIQ stats in the dashboard, but I'm unable to get the statistics mentioned in the attached image. Any idea where I can get the stats for Operator Activity?
        • Default in fields on Form B based on the user selection in Form A

          Hi Everyone, I have added an action button to a form report to bring up a new form based on user selection, see it indicated in red below: Then when the ne form loads, I want to default in some of the fields based on the record the user was selected on.
        • Next Page