Oscar Martinez (Valerock)
Clockify Power BI Template
Updated: Nov 11, 2022
How to integrate Clockify with Power BI.
In this link you will find the Clockify-Power BI GitHub repository. If you want to know more about this, please keep reading.
Clockify is a time tracking app founded in 2017 by Nenad Milanovic; I believe this is the best tool for keeping track of your time. Regardless o having a freemium model gives all the functionality that a team needs for tracking time for free. Yes, there are some nice-to-have paid-only features, but they are "non-critical" and "noncore."
In early 2021 I made public the Clockify Power BI GitHub repository containing the files and code for the app's Power BI template and its custom connector. By this time, I had used the app for about two years and decided to share the template with the Power BI community that had proved so helpful.
Shortly after making the repository public, I contacted Clockify's CEO, Nenad, to see if he had any interest in the connector. To my surprise, Nenad answered me, and I found him and his team very friendly and approachable; this interaction resulted in the addition of the Clockify-Power BI integration page on the app's site.
Clockify Power BI Connectivity
The repository contains the files for two types of connection: through a custom connector and through a template.
The link below will take you to the repository's page where you will find the instruction on how to use the files.
Clockify's Custom Connector
The custom connector is a *.mez file created using Visual Studio, this file adds a new source to the "Get data" options, and the user doesn't interact with the Power Query code to connect to the source.
Despite being a more "natural" experience when connecting, it adds the complexity that the *.mez file needs to be saved on a specific directory in the computer and it gets a bit more complicated if you expect automatic refresh, as you will need to install a gateway and edit its configuration.
This hazzle of saving *.mez files, using a gateway and editing its configuration ruins the experience for the single user and may only be suitable for "enterprise" solutions.
Also, the custom connector does not currently support the "Detailed report" endpoint.
The Clockify template is a *.pbit file, where the user has access, via Power Query, to the code needed to connect to the data.
Time has proved this to be the most popular way of connecting because despite lacking the "natural" get data experience of the connector, the report is natively refreshable from the service and there is no need for gateway configuration or dealing with *.mez files.
When the template file opens, the user needs to input their API key, as well as the years for which they want the detailed report.
Things that you can learn
I have learned tons of things by developing this template and the custom connector, and my intention is that by sharing it other PBI users can leverage Clockify's app as well as learn some very interesting Power Query code like:
Functions and pagination
There are few Power BI developers that know how to create functions for iterating through pages. The template and connector make use of functions to comply with the paging configuration of the API.
The connection is made through " Bearer" authentication, this is one of the most popular ways of authenticating when using API's.
Clockify responses come in JSON format, which by far is the most popular format in APIs, with the template you can learn how these responses are structured and how they need to be expanded.
Finally, I want to thank the Clockify team that I had the opportunity to interact with: Nenad, Aleksandar, and Helen.
Big thanks to Jon, for his valuable contributions to the GitHub Repository.