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

        • Restrict Payment Methods

          Allow us to restrict certain payment methods specific for each customer.
        • Marking a Desk ticket as Unread after merge

          We have a custom script that runs against every new ticket and auto-merges it with any existing ticket that matches our criteria. That works fine but there is no functionality that reverts the newly-updated ticket back to an "unread" state. I found the
        • Issue with Bin Locations and Stock Counting in Zoho Inventory

          Dear Zoho Support, We are currently experiencing a significant issue with bin locations and stock counting in our warehouse. Our warehouse is divided into 7 zones, each containing approximately 250 bin locations. When performing a stock count for an item,
        • How to block a WhatsApp user for sending spam

          Is there a way to block those whatsapp users that just come to play and annoy our service, they also spam us. We have a waba service with sales iq
        • Is it possible to load a Module with a filter pre-applied by the URL?

          In many of the CRM related lists, there is limited sorting, and no filtering available. I thought of the idea of putting a Custom Button on a Related List that would take the user to that module, but PRE-FILTERED by the Account from where they were viewing
        • Automatically create support tickets on a recurring basis

          As mentioned in this post, the idea of a recurring ticket is pretty valid. From time to time, we have to create repetitive tickets (like windows update tasks, restore simulation of backups, check firewall rules for unused entries, and so on). I guess this is a very important tool for Service/Help Desk purposes, so we doesn't have to create a internal schedule (on Microsoft Outlook or Google calendar) to remember to open a new ticket every week/month/etc.
        • Edit ticket number format or append to ticket subject?

          Is there a way to edit the subject in emails sent out from Zoho Desk? At the moment I get: [##123##] Ticket title But this is basically impossible to filter on in Gmail, as [ and # are classified as special characters, so can't be used in a filter. Ideally
        • Workflows being applied and the Large unwanted popup

          When a workflow is being applied do to an action, then the Agent is left with a large Window asking if they would like the see the changes this workflow did. Is there any way to disable this prompt from appearing?
        • Agent view history on tickets

          We are converting to Zoho Desk and am curious if there is a feature that we have in our existing ticketing platform. In our current system, we are able to see which agents have viewed a ticket. It includes their first read and last read of the ticket.
        • Setting priority on tickets created from email channel

          Is there a way to automatically assign a priority to email tickets? We'd like to set them all to standard when they initially come in.
        • Automation #16: Automate Ticket Reopening on Scheduled Timestamp

          Hello Everyone! This edition uncovers the option to schedule reopening a ticket automatically. Zylker Finance tracks insurance policyholder activities through Zoho Desk. For policyholders who pay monthly premiums, tickets are closed upon payment completion.
        • חסרה אופציה בביטול עסקה

          לא מופיע אופציה לכתוב מס הזמנה שעושים ביטול מאתר
        • Help with cookie code, utm variables are overwritten on every page load with new variables

          Hi all, My goal is to track the very first web page that a user visits, and store those utm values throughout all of the future visits until a lead form is submitted. That way, if a person is retargeted, I can still attribute the very first visit as the
        • Introducing Bot Filtering for Accurate Email Campaign Analytics

          Dear Marketers, We're excited to announce a new feature designed to enhance the accuracy of your email campaign analytics: bot filtering. This feature helps you filter out bot-generated opens and clicks, ensuring your campaign reports reflect genuine
        • Automation #9 - Convert Zoho Desk Tickets to New Deals in Zoho CRM

          This is a monthly series designed to help you get the best out of Desk. We take our cue from what's being discussed or asked about the most in our community. Then we find the right use cases that specifically highlight solutions, ideas and tips on optimizing
        • Ticket Assignment tool

          I have built an tool which help to assign the emails to the specific department but I want to use it with zoho desk or if its possible then you can help me with it to use it on your wide scale
        • Restructured the Company Information page into distinct sections

          Hello everyone, We’ve made significant updates to the Company Information page to enhance usability and streamline your experience. These changes are part of our ongoing efforts to restructure the feature pages across the product. What has changed? Previously,
        • Zoho Books Invoices Templates

          It would be really helpful to have more advanced features to customise the invoice templates in Zoho Books. Especially I´m thinking of the spacing of the different parts of the invoice (Address line etc.). If you have a sender and receiver address in
        • Customers would like to add tips when paying in Client Portal

          I am happy with the clean interface of the Client Portal. However, I am running into a challenge: my customers would like to be able to add tips/gratuities when making payments. Currently, this is very clunky because they have to 1) manually over-pay,
        • How can I add a calendar invite to my campaign emails?

          I use Zoho Campaigns to attract prospects to a series of webinars that we run. I have a general pool of contacts that I campaign to, and I have them join a new list for the specific webinar they wish to join. What I would like to do next is send an email to those that want to join a webinar, with a calendar invite that they can accept to add to their Outlook calendars (containing the URL and details of the webinar). How can I do this?
        • Exit Sub

          Hi Everyone, I have some script that evaluates multiple conditions, using some nested if statements.  If any of the conditions evaluates to true, there is no reason to continue the running through the other conditions. Is there an Exit Sub command in Deluge? Thanks, Leo
        • Please add support for a "return" statement that can be used in the middle of a function

          I'd really appreciate the ability to use a validity test near the beginning of a Deluge function and exit the function early if the test fails. That is, support a "return" keyword that immediately exits the function. This helps avoid messy concentric
        • Case and Left Join Problem

          I am attempting to find the cost per lead, however they are on different tables. I am using the Case and Left Join Functions to do so. The following Queries are working correctly. These are below: SELECT "Campaign", COUNT("Id") AS 'total_leads' FROM "Deals"
        • Calling a function within another function

          Hello there, I have just found out that you can simply call up functions in other functions, regardless of the department. You can't create functions with the same name twice, even though you are in a different department. If you try it, you don't get
        • Enhancing Data Accuracy: Bot Filtering & Apple Mail Privacy Protection Compliance

          Dear Marketers, The wait is over! We’re thrilled to share that the enhanced bot filtering feature is now live in Zoho Marketing Automation. Thank you for your patience as we refined this tool to deliver deeper insights into your campaign performance.
        • High cpu load on client side by process sessionaudit.exe

          Hi, as stated above. This happens every time with different clients. Now, the first thing I have to do after making the connection is to go to taskmanager on client computer and kill the process 'sessionaudit.exe' If I don't their cpu is very high and
        • Recurring Events Not Appearing in "My Events" and therefore not syncing with Google Apps

          We use the Google Sync functionality for our events, and it appears to have been working fine except: I've created a set of recurring events that I noticed were missing from my Google Apps calendar. Upon further research, it appears this is occurring
        • Posibility to add Emoticons on the Email Subject of Templates

          Hi I´ve tried to add Emoticons on the Subject line of Email templates, the emoticon image does show up before saving the template or if I add the Emoticon while sending an Individual email and placing it manually on the subject line. Emoticons also show
        • Case assignment rules cannot be triggered when records are created manually???

          I am new to Zoho, (Coming out of Salesforce) and I am shocked that Case assignment rules do not work for manually created cases. I think this is a basic need for a CRM and should be a functionality for Zohos native cases module. In Salesforce the Case
        • Zoho DataPrep and File Pattern configuration

          I'm using Zoho data prep to ingest data from One Drive into Zoho Analytics... The pipeline is super simple but I can't any way to get all the files that I need. Basically I need to bring all the files with a certain pattern and for that I'm using a regex
        • Is there an equivalent to the radius search in RECRUIT available in the CRM

          We have a need to find all Leads and/or Contacts within a given radius of a given location (most likely postcode) but also possibly an address. I was wondering whether anyone has found a way to achieve this in the CRM much as the radius search in RECRUIT
        • Restrict SalesIQ Account Notifications to Admins

          Dear Zoho SalesIQ Team, We appreciate the continuous improvements in SalesIQ. However, we have noticed that all users, including employees who do not have admin privileges, receive certain account-related notifications—such as the recent splash screen
        • Feature Request: Search in the PC client. Some thoughts about the search.

          Hi all. I'm really excited to start using Zoho Notebook, but I'm missing some of the search capabilities on my desktop. There are also some thoughts on improving search in general. Search is very important to me, without it it is difficult for me to use
        • Introducing an option to set comments to public by default

          Hello all, Greetings! We are pleased to announce that Desk's user preferences now brings an option to set a comment type as Public or Private by default. In addition to setting reply buttons as defaults, Agents or Admins can now choose to make their ticket
        • Trying to setup a record to automatically create on a weekly basis

          Hello all, I need multiple records to be automatically created on a weekly basis. What I'm trying to accomplish is, I have a maintenance database where I track when I work on IT related systems. Every week on the same days I perform backups on systems
        • How to display Motivator components in Zoho CRM home page ?

          Hello, I created KPI's, games and so but I want to be able to see my KPI's and my tasks at the same time. Is this possible to display Motivator components in Zoho CRM home page ? Has someone any idea ? Thanks for your help.
        • Workflow rule to assign new case owner sends email to customer from Original owner issue

          I have a workflow rule to assign a manually created case from a sales rep. to a customer service repr to handle. I also have a workflow rule to send an introduction email from the case owner to the customer. The Problem: The email is going out on behalf
        • Annotate PDFs is Shown as New, but Where is it?

          In September 2017, "Annotate your PDF files" is shown under "Enhancements and bug Fixes". But no link. Where can I learn how to use the feature? https://www.zoho.com/notebook/whats-new.html
        • 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
        • 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
        • Next Page