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

        • Introducing Booking Pages—a topping for your Calendar Scheduling needs!

          Greetings, We're here with a new topping for Bigin! Let's dive into the details. What does this topping do? Scheduling appointments with customers is one of the most common challenges small businesses face on a daily basis, as it often involves frequent
        • Debugging `try` blocks : Tip

          I find it annoying that if one line inside a `try` block has an error, the Deluge arser points the beginning of the block to the location of the error. BUT, if you temporarily comment out the initial `try {`  The parser goes through the whole block and
        • [Product Update] TimeSheets module is now renamed as Time Logs in Zoho Projects.

          Dear Zoho Analytics customers, As part of the ongoing enhancements in Zoho Projects, the Timesheets module has been renamed to Time Logs. However, the module name will continue to be displayed as Timesheets in Zoho Analytics until the relevant APIs are
        • Use approval workflow comments in record scripts

          Greetings, i'm running an approval workflow for my records, during approval/rejection there is a step where comments are entered. i want to add there comments to the record and to use them in various deluge scripts like sending emails and so on.  how
        • ZOHO Store

          Not able to make a payment We are using Zoho One, and we are from India. The payment currency, which shows for us, is in USD. But the system says we can choose Country/Region India if it shows INR only. Attaching screenshots for more info.
        • Support Migration into Aliases in Zoho Mail

          Hello Zoho Mail Team, How are you? We are in the process of migrating some of our users from Google Workspace (Gmail and Google Drive) to Zoho. During this process, we noticed that Zoho Mail currently only supports migration into a primary mailbox and
        • API for Z Workdrive Flow Make-Integromat ?

          We are zoho workdrive fans Also we would like to have an api to work with Zoho Flow or with Make better known by its old name INTEGROMAT Is it planned and when? 3 months -6 months or more?
        • Apps Pane no longer visible

          I have read all the info and help and nothing works, I do not have a "show apps" anywhere and I can no longer see my Apps pane in the left hand side of mail, please advise how to get this back
        • Canvas View - Print

          What is the best way to accomplish a print to PDF of the canvas view?
        • 5名限定 課題解決型ワークショップイベント Zoho ワークアウト開催のお知らせ(8/21)

          ユーザーの皆さま、こんにちは。Zoho ユーザーコミュニティチームの藤澤です。 8月開催のZoho ワークアウトについてお知らせします。 今回はZoomにてオンライン開催します。 ▷▷参加登録はこちら:https://us02web.zoom.us/meeting/register/eVOEnBsSQ2uvX4WN5Z5DeQ ━━━━━━━━━━━━━━━━━━━━━━━━ Zoho ワークアウトとは? Zoho ユーザー同士で交流しながら、サービスに関する疑問や不明点の解消を目的とした「Zoho
        • New in Zoho Forms: Inline OTP Verification

          Hello form builders, We are excited to announce the launch of Inline OTP Verification in Zoho Forms, a smarter way to ensure the authenticity of the contact details you collect. Until now, OTP Verification in Zoho Forms worked as a pre-access step: respondents
        • Zoho Mail : Associate emails with Meeting records and allow multiple emails to be assocaited at once

          Is there a workaround that would allow either of these? I want to associate emails with Meeting records. I also would like to be able to select multiple emails at once for association with a record.
        • Create task from email

          Is there a way on mobile to create a task from an email? I use this feature a lot and when traveling now I read email on mobile. By the time I get to my office I forget about them since I didn't add it to a task. Is this feature missing on moble?
        • Zoho Socials - Unable to view Channels and SmartQ

          Hi, The channel Facebook has been added by the admin, however, it is not visible on the User level (employee). Other channels are visible. Also, we have the premium account, and SmartQ is not working. Can anyone help? Regards, Priyanka
        • Eliminating Manual Consolidation: Automating Currency Field Sync from Task to Project

          Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
        • We want to set the "Converted from Lead" value in Deals using a Workflow or via a Deluge script. How?

          For use in Zoho Analytics, we need the field "Converted from Lead" filled in our deal records. This field is empty everywhere, because we do not create deals directly when converting a lead to a contact. We want to do that using the API or a workflow
        • Sales Orders: Quoted_Items + items in another subform -> into Ordered_Items ?

          hello, When creating Sales Orders, is it posible to inherit/fill the Ordered_Items with all the items from Quoted_Items + all the items from a customized subform with similar fields? Since you can create a sales order in different ways (convert, new -
        • How to cancel the GSTR1 pushed to GSTN

          How to cancel the GSTR1 Pushed to GSTN, some rectifications to be done in HSN & SAC code
        • Zoho Books API — Invalid Operation Type / Scope does not exist

          Hello Team, We are unable to use the Zoho Books API from our registered application. We’ve already: Created a client in Zoho API Console using (Admin in Books) Generated the OAuth code and token successfully Used the correct scopes: ZohoBooks.fullaccess,ZohoOauth.userinfo.READ
        • Enhancements in Canvas

          Dear All, Greetings! Canvas lets you design the record details page to suit your brand or business preferences. We are glad to introduce the following enhancements to uplift your design experience. Reusable Components Style Presets Let's go! Reusable
        • Minimum order quantity

          Is there a way to enforce a minimum order quantity - ie has to have a minimum of 250?
        • 【Zoho CRM】ポータル機能のアップデート:UIとポータルの作成フローの変更

          ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 今回は「Zoho CRM アップデート情報」の中から、ポータル機能のアップデートをご紹介します。 目次 概要 ユーザーグループの作成フローの変更 ユーザーグループ詳細画面内のタブについて 「タブと権限」タブについて 「設定」タブについて 概要 UIとポータルの作成フローが変更されました。ポータルの新機能に先立ち、UIを一部変更しました。タブやオプションの配置を見直し、機能へよりアクセスしやすくなっています。 また、「ポータルユーザーの種類」は今後、「ユーザーグループ」と呼称され、ページ上のボタンも「ユーザーグループを作成する」に変更されます。
        • Tax on Imported goods charged by Shipping Company

          Hi Folks, I imported goods from outside Canada, for better understanding I will give an example data. imported goods value: 2000$ The shipping company sent me an invoice containing the following information: Custom duty on imported goods: 400$ Administration
        • Prefilled Date fields auto-changed and then locked when using “Edit as new”

          If a document out for signature has date fields (not SignedDate fields) that were pre-filled before sending, and then you use “Edit as new” to create a new version of the same document, the value of those date fields gets automatically changed to today
        • Zoho Webinar via Social Media

          Hello, is it possible to stream a Zoho Webinar via Social Media like Linkedin or Facebook?
        • Add Hebrew & RTL Support to Feedback Widget

          Hello Zoho Desk Team, How are you? We are using Zoho Desk and would like to utilize the Feedback Widget. While Zoho Desk itself supports Hebrew and RTL, the Feedback Widget unfortunately does not. We kindly request that Hebrew and full RTL support be
        • OAUTH2 isn't working with Power Automate and N8N (Zoho Desk)

          Hello, I am trying to set up an OAuth2 connection to the Zoho Desk API, but the authentication flow fails immediately. I am experiencing this issue in two separate platforms: Microsoft Power Automate (using a Custom Connector) and n8n. Instead of being
        • Kit Items Breaking Automations - "Provide mapped components for all kit items"

          This has been brought up in other threads, but I believe this issue warrants its own topic. Whenever a sales document (Estimate, Sales Order, Invoice) is created or manipulated programmatically, trying to include a Kit as an Item throws this error: "Provide
        • Show item Cost value on Item screen

          The Item screen shows Accounting Stock and Physical Stock. It would be very helpful if value information could be displayed here as well, for instance Cost Price. Currently, to find the Cost Price (as used for inventory valuations) from inside the item
        • Mark shipment as delivered via api

          Hellloooo again Zoho guys !! More help required if you would be so kind, pleeeezz..... var options =        {         'method' : 'post',         'contentType' : 'application/json',         'muteHttpExceptions' : true       }; var myPackNo  = encodeURIComponent('###################');
        • Setting Alternative units for an item.

          Hello Team, How to create alternate units for an item. We are placing orders for stocks in boxes. One box contain 24 items. At the time of selling we have two categories of buyers wholesalers and retailers. So the sales will be in PCS and in boxes also.
        • Zoho Inventory search when adding items to SO/PO, etc.

          I do not see that Zoho Inventory searches within the item name for an item lookup. We have many products with variants. So when I search for a product, say a lighting system, and it comes in different sizes and colors, I can only get those products where
        • Item Group Attributes

          Hello, I would like to see more attributes under grouped items. We sell car parts, there are several suppliers for the same part but under different brands. We want to group them together but the attributes under groups are lacking. For example, the products
        • Remove HTML Format - Deluge

          Hello @all if you want to delete the HTML format from the text please follow the script. Data = "Text"; info Data..replaceAll("<(.|\n)*?>" , "").replaceAll("&nbsp;" , " "); Apart from this if you require anything please let me know Thanks & Regards Piyush
        • Using multiple languages in template

          I wanted to add the company name in the template in arabic. I found a way through the header and footer option, except when i print the quotation the arabic disappears both in the top and bottom of the page. I have attached pictures of the before and
        • ADDING 5% VAT TO PURCHASE ORDERS GENERATED ON ZOHO BOOKS UAE

          Please guide on how to add 5% VAT to Purchase Orders generated on ZOHO Books UAE edition.
        • Import from /csv file, some items fail with the error "Specify Tax Or Tax Exemption".

          Hello! I am trying to import a csv file of all of my expenses for a complete financial year. I get errors for some items with the error message "Specifiy Tax or Tax Exemption". These errors only occur on lines where I have "Postage" as the expense account.
        • About maximum number of requests per minute

          Hi, Our company has integrated Zoho inventory and we're using the shipping order creation and update functions and so on. Currently we're receiving "For security reasons you have been blocked for some time as you have exceeded the maximum number of requests
        • Approval - Report/Views

          Hi, On Zoho Desk - Is there a way to report on pending approvals, or a view or similar?
        • "Zoho CRM Integration" option is missing in Zoho Social Settings

          I am trying to integrate my Zoho Social account with my Zoho CRM account. I am on the Professional Trial plan and my user role is "Brand Admin". However, I cannot find the "Zoho CRM Integration" or "Lead Generation" option anywhere in my Zoho Social settings.
        • Next Page