How to: Monitor my weekly completed tasks from Notion over time
Context
This article is following a previous article I wrote about “How to get weekly email with my completed tasks from notion”. I suggest you to read this article before going further here.
After being able to connect to Notion API and get a weekly reminder of completed tasks of the previous week, I decided to go a step further by monitoring over time all these tasks completed by creating a dashboard.
To do so, I decided to use only the following tools : Google Sheet to store my data and to create my dashboards, Notion API to get the data and Integromat to weekly call Notion API and feed my Google Sheet.
Step 1: Create a Google Sheet
This step is rather easy, just create a Google Sheet in your Google drive and create 2 spreadsheets: one for storing your data and an other one for your upcoming and sparkling dashboards ⭐.
In the speadsheet where my data will be stored, I’ve created 4 columns to be mapped with my Notion data: Completion date, Task name, Epic and creation date.
Step 2: Update Notion API call
In Integromat I already used a flow that was calling Notion API to get my past week completed tasks. Obviously, my idea was to capitalize on this existing integration process by just adding a new branch into this Integromat scenario that will manage the storage of API data in the new spreadsheet.
Since I wanted my tasks to be sorted by “Completion date” I had to update my Notion API call. Notion API provides a way to sort data by giving in the body of the API a sort parameter, see below in bold:
{ "filter": { "and": [{ "property": "Last update date", "last_edited_time": { "past_week": {}}}, { "property":"Status", "select": { "equals": "Completed"}}]}, "sorts": [{ "timestamp": "last_edited_time", "direction": "ascending"}]}
Step 3: Update Integromat scenario
- Update HTTP module with the previous code
- Add a router element to create a new branch that will manage the data storage
- Add a Google Sheet element after the router element. Connect this Google Sheet element to your spreadsheet and map API fields with spreadsheet fields.
- Your flow is set up, ready to pull and load data into your spreadsheet.
N.B: Date format from Notion API was not exactly the one I wanted to use in my spreadsheet. So in Integromat Google Sheet module I chose to format the date like following:
formatDate(substring(toString(9.properties.`Last update date`.last_edited_time); 0; 10); "DD-MM-YYYY")
Step 4: Dashboard creation
For my dashboard I wanted to keep track of my weekly performance. Am I doing better than a previous week ? What is my best week or day ? Am I in a good trend or am I stuck ? To answer these questions I decided to keep track on the following KPI:
- Total tasks completed this year
- Highest number of completed tasks in one day and the date
- How much time since I did not beat record
- My weekly amount of completed tasks with average completed tasks by week and a moving average from the previous 4 weeks
- Average completion time (in days), maximum completion and minimum completion by weeks
Conclusion
Of course this monitoring system is far from being perfect — for instead counting the number of tasks is very arbitrary (a tasks that takes 5 secondes to be done counts as much as a task that takes 3 days) — nevertheless it shows how easy it could be to leverage Notion API to track whatever you want with no code tools such as Integromat and Google Sheet.