Automating Attendance Tracking with Zoho Cliq Developer Platform

Automating Attendance Tracking with Zoho Cliq Developer Platform

I wish remote work were permanently mandated so we could join work calls from a movie theatre or even while skydiving! But wait, it's time to wake up! The alarm has snoozed twice, and your team has already logged on for the day.



Keeping tabs on attendance shouldn't feel like guiding a flock of rebellious sheep. Hence, let's automate check-in and check-out notifications using the Zoho Cliq Platform Schedulers and the Zoho People API, eliminating the guesswork in attendance management and reducing the risk of errors associated with manual monitoring.

How does this solution benefit a business?

  1. Real-time reminders reduce instances of ghost check-ins and ensure accurate recording of everyone's logged hours.
  2. Essential for attendance tracking, payroll accuracy, compliance with labour laws, and audits.
  3. The entire team stays informed, fostering a cohesive workflow that eliminates the need for micromanagement.      
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 any unique name with the scopes - ZohoPeople.Attendance.ALL , ZohoPeople.forms.ALL and ZohoPeople.leave.ALL

ⓘ Document for reference : Connections in Cliq 

 

How to obtain or locate the channel unique name in Cliq?

  • Navigate to the top right corner of the channel and locate the three dots. Click it.

  • In the menu that appears, select "Channel info" and a pop-up will open, displaying detailed channel information.

Hover over the "Connectors" section and click it. Under "API Parameters," you will find the Channel ID and unique name.
We need to create two schedulers, specifically one for check-in and another for check-out.
  1. After a successful login in Cliq, hover to the top right corner and click your profile. Post clicking, navigate to Bots & Tools > Schedulers.
  2. On the right, click the "Create Scheduler" button.
  3. To learn more about schedulers and their purposes, refer to the Introduction to Schedulers.
  4. Create a scheduler using your preferred name. Specify the following details: the scheduler name and a description.  

  1. For the recurring period, choose the type "Weekly." Select Monday through Friday and set the time of execution to 11 AM or any other time that aligns with your company's check-in time, or customise the recurring period based on your specific use case.
  2. Finally, click "Save & edit code" and paste the following code.
  1. currentDate = zoho.currentdate;
  2. currentDateString = currentDate.toString("dd-MMM-yyyy");
  3. fromIndex = 1;
  4. toIndex = 200;
  5. // Get all active users
  6. users = zoho.people.getRecords("employee",fromIndex,toIndex,{},"{CONNECTION_LINK_NAME}");
  7. usersList = List();
  8. usersList.addAll(users);
  9. iterations = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25};
  10. // Get All Employees ( 4000 MAX )
  11. if(users.size() == 200)
  12. {
  13. for each  iteration in iterations
  14. {
  15. fromIndex = fromIndex + toIndex;
  16. toIndex = toIndex + 200;
  17. users = zoho.people.getRecords("employee",fromIndex,toIndex,{},"{CONNECTION_LINK_NAME}");
  18. if(users.size() > 0 && users.size() == 200)
  19. {
  20. usersList.addAll(users);
  21. }
  22. else if(users.size() > 0 && users.size() < 200)
  23. {
  24. usersList.addAll(users);
  25. break;
  26. }
  27. else
  28. {
  29. break;
  30. }
  31. }
  32. }
  33.  
  34. // Get all the employees checkedin from the morning.
  35. getAttendenceEntries = invokeurl
  36. [
  37. url :"https://people.zoho.com/api/attendance/fetchLatestAttEntries?duration=240"
  38. type :GET
  39. connection:"{CONNECTION_LINK_NAME}"
  40. ];
  41. latestAttendanceRecords = getAttendenceEntries.get("response").get("result");
  42. checkedInUsers = List();
  43. for each  userRecord in latestAttendanceRecords
  44. {
  45. checkedInEmployeeEmail = userRecord.get("emailId");
  46. checkedInUsers.add(checkedInEmployeeEmail);
  47. }
  48.  
  49. // Get all the employees who applied for leave both approved and pending ( Remove PENDING to exclude only the leave approved employees )
  50. leaveApprovedEmployees = invokeurl
  51. [
  52. url :"https://people.zoho.com/api/v2/leavetracker/leaves/records?from=" + currentDateString + "&to=" + currentDateString + "&dateFormat=dd-MMM-yyyy&approvalStatus=[APPROVED,PENDING]"
  53. type :GET
  54. connection:"{CONNECTION_LINK_NAME}"
  55. ];
  56. info  leaveApprovedEmployees;
  57. leaveApprovedEmployeesList = List();
  58. for each  member in leaveApprovedEmployees.get("records")
  59. {
  60. leaveApprovedEmployeesList.add(member.get("EmployeeId"));
  61. }
  62. info leaveApprovedEmployeesList;
  63.  
  64.  
  65. // Add the users to yet to checkin list if they are not checked from the morning and not applied for leave
  66. usersYetToCheckIn = list();
  67. for each  user in usersList
  68. {
  69. employeeEmail = user.get("EmailID");
  70. employeeId = user.get("EmployeeID");
  71.     employeeStatus = user.get("Employeestatus");
  72. if(!checkedInUsers.contains(employeeEmail) && !leaveApprovedEmployeesList.contains(employeeId) && employeeStatus.equals("Active"))
  73. {
  74. usersYetToCheckIn.add(employeeEmail);
  75. }
  76. }
  77.  
  78. // Mention the list of users in the channel.
  79. if(usersYetToCheckIn.size() == 0)
  80. {
  81. info "No users were found yet to checked-in at 11 PM today. Great to see everyone wrapping in on time! ✅";
  82. }
  83. else
  84. {
  85. usersYetToCheckInString = "";
  86. for each  user in usersYetToCheckIn
  87. {
  88. usersYetToCheckInString = usersYetToCheckInString + "[" + user + "](mail:" + user + ") \n";
  89. }
  90. usersYetToCheckInString = usersYetToCheckInString.subString(0,usersYetToCheckInString.length() - 2);
  91. response = Map();
  92. card = Map();
  93. card.put("title","Employees who haven’t checked in yet ( " + usersYetToCheckIn.size() + " )");
  94. card.put("thumbnail","https://i.pinimg.com/originals/85/e9/f3/85e9f3f5ac31fc5aab586e208297f43d.gif");
  95. card.put("theme","modern-inline");
  96. response.put("card",card);
  97. response.put("text",usersYetToCheckInString);
  98. info zoho.cliq.postToChannel("{CHANNEL_UNIQUE_NAME}",response);
  99. }

  1. Now, let's follow the same steps and create a scheduler for checkout reminders. Under the recurring period, choose the type as "Weekly." Select Monday through Friday and set the time of execution to 7 PM or any other time that aligns with your company's checkout time, or customise the recurring period based on your specific use case.
  2. Click "Save & edit code" and paste the following code.
  1. attendanceResponse = invokeurl
  2. [
  3. url :"https://people.zoho.com/api/attendance/fetchLatestAttEntries?duration=600"
  4. type :GET
  5. connection:"{CONNECTION_LINK_NAME}"
  6. ];
  7. info attendanceResponse;
  8. todayDate = zoho.currenttime.toString("YYYY-MM-dd");
  9. latestAttendanceRecords = attendanceResponse.get("response").get("result");
  10. usersWithoutCheckout = list();
  11. if(latestAttendanceRecords.size() > 0)
  12. {
  13. for each  userRecord in latestAttendanceRecords
  14. {
  15. userEmail = userRecord.get("emailId");
  16. dailyEntries = userRecord.get("entries");
  17. for each  dailyEntry in dailyEntries
  18. {
  19. if(dailyEntry.containsKey(todayDate))
  20. {
  21. todayEntryDetails = dailyEntry.get(todayDate);
  22. attendanceLogs = todayEntryDetails.get("attEntries");
  23. for each  logEntry in attendanceLogs
  24. {
  25. if(!logEntry.containsKey("checkOutTime"))
  26. {
  27. usersWithoutCheckout.add("{@" + userEmail + "}");
  28. }
  29. }
  30. }
  31. }
  32. }
  33. }
  34. usersWithoutCheckoutString = usersWithoutCheckout.toString("\n");
  35. if(usersWithoutCheckoutString.trim().length() == 0){
  36. usersWithoutCheckoutString = "No users were found checked-in after 7 PM today. Great to see everyone wrapping up on time! ✅";
  37. }
  38. response = Map();
  39. card = Map();
  40. card.put("title","List of users who remain checked in ( " + usersWithoutCheckout.size() + " )");
  41. card.put("thumbnail","https://media.tenor.com/Hd8nLZZTPRYAAAAi/alarm-clock-alarm.gif");
  42. card.put("theme","modern-inline");
  43. response.put("card",card);
  44. response.put("text",usersWithoutCheckoutString);
  45. info zoho.cliq.postToChannel("{CHANNEL_UNIQUE_NAME}",response);

Wrapping up and checking out for the day, hopefully

Whether you're from HR, tired of chasing attendance logs, or an enthusiastic team lead trying to increase your team's visibility and adjust workload accordingly, Cliq Platform's schedulers are essential and ensure that accurate tracking is consistent and compliance is maintained. Additionally, this would be scalable to handle organizations of any size.

If attendance tracking is a binge-watchable series, what plot twist would these reminders add to your team's script? Let us know in the comments below!


      • Sticky Posts

      • Automate attendance tracking with Zoho Cliq Developer Platform

        I wish remote work were permanently mandated so we could join work calls from a movie theatre or even while skydiving! But wait, it's time to wake up! The alarm has snoozed twice, and your team has already logged on for the day. Keeping tabs on attendance
      • 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
      • Customer payment alerts in Zoho Cliq

        For businesses that depend on cash flow, payment updates are essential for operational decision-making and go beyond simple accounting entries. The sales team needs to be notified when invoices are cleared so that upcoming orders can be released. In contrast,
      • 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

        • Recent Topics

        • Automation#34 : Automate Email threading for Ticket notification

          Hello Everyone, It's been a while since we've presented an automation. However, our community has been buzzing with ideas, use cases, and discussions with our community experts and Ask the Experts session. So, here we are again, presenting an automation
        • Automation#35 : Auto-Add Comments under the Owner's Name in Tickets via Macros

          Hello Everyone, This week's custom function provides simple steps to configure a Macro for adding comments to tickets with the name of the Comment owner. When managing tickets, you can use the Comment feature to communicate internally with your team and
        • Automation#36: Auto-create time-entry after performing the Blueprint transition

          Hello Everyone, This week’s edition focuses on configuring a custom function within Zoho Desk to streamline time tracking within the Blueprint. In this case, we create a custom field, and request the agent to enter the spending time within the single
        • Automation#33: Automate Splitting Names for Existing Contact Records

          An organized directory – who doesn't love one? Previously, we explored how to split contact names into First Name and Last Name for new contacts in Zoho Desk. But what about existing contacts already in your database? This week, we bring you a custom
        • About Meetings (Events module)

          I was working on an automation to cancel appointments in zoho flow , and in our case, we're using the Meetings module (which is called Events in API terms). But while working with it, I'm wondering what information I can display in the image where the
        • import data from Apollo.ai into zoho crm via zoho flow

          I might be asking this question in the wrong forum. We use Apollo.ai to find potential new leads for our business, there are around 10000 leads that we have initially found. We have an Apollo.ai account but just to do searches, we dont use it as a crm.
        • Fix the speed

          It takes ages to load on every step even though my dataset is quite small.
        • Workqueue

          I really like the idea of the Workqueue generally - it will be really useful. What it seems to lack however, is the ability to customise it properly. I want to be able to show a custom view rather than just "My Leads" and "Leads Assigned in Last 3 hours".
        • Webform & spam

          Hi, We set up 2 webform on our website, fowarding the content to Zoho CRM. Since it has been opened up, we are getting lot of spam message (for now about 20 a day). To lower the amount of false new leads we added the captcha field and new enquieries are
        • Zoho CRM Web form page URL

          Hi there, I am getting quite a bit of spam through my Zoho CRM Web form and want to restrict the URLs it is submittable from. I can see that I can add Location URLs but I need to be able to just add a domain so can I enter mydomain.com/* to cover all
        • Receiving too many Spam Leads. Why?

          I am receiving so many junk leads from web forms created by zoho's platform. The junk queries are increasing day by day and are affecting our business. I am continuously following up with zoho team from the past one year but not getting any satisfactory
        • Mail Merge is not working properly as far as the AUTOMATE section is concerned

          Hi there, I created a Mail Merge template for the Deal module. I would like Deal owners to mail merge their Deal records, download the Mail Merge document as a Word doc and make a few changes before sending it to the customer. Thing is, neither the "Merge
        • Canvas Detail View Related List Sorting

          Hello, I am having an issue finding a way to sort a related list within a canvas detail view. I have sorted the related list on the page layout associated with the canvas view, but that does not transfer to the canvas view. What am I missing?
        • project name field issue- n8n

          Hey guys, I have a question. I want to create a new product using the workflow. The problem is with the product name field; I don't know how to fill it in. The workflow starts with retrieving information from the leads table, retrieving links to scrape
        • Function #20: Custom calculation in item table of invoices

          When you create an invoice in Zoho Books, the 'Amount' of a line item is typically calculated as the product of the "Quantity" and the "Rate" of the item. For instance, if an item has a sales rate of $50 and a quantity of 5 is sold, then the amount would
        • Flexible Partial-Use Coupons (Stored Value Credits)

          Subject: Feature Request: Ability for users to apply partial coupon balances per transaction Problem Statement Currently, our coupons are "one-and-done." If a user has a $50 coupon but only spends $30, they either lose the remaining $20 or are forced
        • How to track repeat customers?

          I own a food business and every order is entered into Zoho with: a unique Customer ID total order amount date of order With this information, I want to be able to see a list of my "best" customers. In other words, descending lists arranged according to:
        • How to hide or archive a blog post temporarily in Zoho commerce website builder?

          I would like to temporarily hide or archive a blog post in zoho commerce website builder so that it doesnt appear on my website till I enable it again. I tried to look for this option but could not find it.  It only allows me to permanently delete a blog
        • Button to Reapply Filters on Sheet(s)

          I wrote a macro that I attached to a button to reapply the filters on all my sheets and it says it works, but it doesn't actually do anything. What is wrong with it? Is there another way? Or even make it work for one sheet? Sub UniversalFilterRefresh()
        • Zoho Books - Breaking A Working App

          We've been using Zoho for many years now. Across all apps, entering phone numbers in standard formats was enabled in all apps. These formats are: xxx.yyy.zzzz xxx-yyy-zzzz (xxx) yyy-zzzz and we were able also to add extension numbers in these formats:
        • Automate pushing Zoho CRM backups into Zoho WorkDrive

          Through our Zoho One subscription we have both Zoho CRM and Zoho WorkDrive. We have regular backups setup in Zoho CRM. Once the backup is created, we are notified. Since we want to keep these backups for more than 7 days, we manually download them. They
        • Can you default reports/charts to report the current week?

          Our data table maintains two years of data. Management wants certain report to automatically filter the report to the latest calendar week. I know I can do this manually with filters but I want the report to automatically default to the latest calendar
        • Build data protection into your support

          At Zoho, privacy is our principle. Every Zoho product is built with privacy as the foundation and the finishing touch, guiding every decision we make. Security, privacy, and compliance are woven into the software development lifecycle, starting from how
        • Conditional formatting: before/after "today" not available

          When setting conditional formatting, it only allows me to set a specific calendar date when choosing "Before" or "After" conditions. Typing "today" returns the error "Value must be of type date". Is there a workaround? Thanks for any help!
        • Zoho mail account ownership transfer

          We recently took over another company and have assumed responsibility for its Zoho account, including Zoho Mail and all related services. We would like to formally transfer ownership of this account to our organization. Could you please outline the complete
        • Display Client Name in Zoho Creator Client Portal Dashboard

          Hello Zoho Creator Team, We hope you are doing well. Zoho Creator recently introduced the option to set a client’s display name in the Client Portal settings, which is very helpful for providing a personalized portal experience. However, there is currently
        • Customizable UI components in pages | Theme builder

          Anyone know when these roadmap items are scheduled for release? They were originally scheduled for Q4 2025. https://www.zoho.com/creator/product-roadmap.html
        • Stop the Workarounds: We Need Native Multi-Step Forms

          After over 17 years of community requests, I'm hoping the Zoho team can finally address the lack of native multi-page form support in Zoho Creator. This has been one of the longest-standing feature requests in the community, with threads spanning nearly
        • Amazon.in FBA multiple warehouse integration with Zoho Inventory

          My organisation subscribed to Zoho One looking at the opportunity to integrate Amazon.in with Inventory. But during the configuration, we understood the integration has severe limitations when it involves multiple warehouses in the same Organisation.
        • Introducing Workqueue: your all-in-one view to manage daily work

          Hello all, We’re excited to introduce a major productivity boost to your CRM experience: Workqueue, a dynamic, all-in-one workspace that brings every important sales activity, approval, and follow-up right to your fingertips. What is Workqueue? Sales
        • Feature Request - Set Default Values for Meetings

          Hi Zoho CRM Team, It would be very useful if we could set default values for meeting parameters. For example, if you always wanted Reminder 1 Day before. Currently you need to remember to choose it for every meeting. Also being able to use merge tags
        • Issues with Actions By Zoho Flow

          Hi, I have a workflow that fires when a deal reaches a stage. This then sends out a contract for the client to sign. I have connected this up through Actions by Zoho Flow. Unfortunately this fails to send out. I have tracked it down to the date fields.
        • Adding custom "lookup" fields in Zoho Customization

          How can I add a second “lookup” field in Zoho? I’m trying to create another lookup that pulls from my Contacts, but the option doesn’t appear in the module customization sidebar. In many cases, a single work order involves multiple contacts. Ideally,
        • CRM x WorkDrive: We're rolling out the WorkDrive-powered file storage experience for existing users

          Release plan: Gradual rollout to customers without file storage add-ons, in this order: 1. Standalone CRM 2. CRM Plus and Zoho One DCs: All | Editions: All Available now for: - Standalone CRM accounts in Free and Standard editions without file storage
        • Windows Desktop App - request to add minimization/startup options

          Support Team, Can you submit the following request to your development team? Here is what would be optimal in my opinion from UX perspective: 1) In the "Application Menu", add a menu item to Exit the app, as well as an alt-key shortcut for these menus
        • Ability for admin to access or make changes in zoho form without asking for ownership

          Currently in zoho form only form owner can make the changes in the form and if someone else has to make changes then we have to transfer the ownership to them and even admin also cant access it . So i think admin must have the ability or option to access
        • Issue with WhatsApp Template Approval and Marketing Message Limit in Zoho Bigin

          We are facing issues while creating and using WhatsApp message templates through Zoho Bigin, and we request your clarification and support regarding the same. 1. Utility Template Approval Issue Until December, we were able to create WhatsApp templates
        • Zoho CRM Calendar View

          Hello Zoho team, We need desperately a calendar view next to list, kandan and other views. I think it should be easy to implement as you already have the logic from Projects and also from Kanban View in CRM. In calendar view when we set it up - we choose
        • Camera

          I can sign on to a meeting and see the other participants, but my screen is dark. The instructions for Zoho "Camera Settings" say "click on lock icon in address bar," but I don't see that icon! Suggestions?
        • What is Workqueue and how to hide it?

          Hi, My CRM suddenly have this "Workqueue", may I ask how to set the permission of this tab?
        • Next Page