We saw how to create dashboards with Serenytics in that article.
Now we're going to find out how to filter these dashboards using the logged-in user's ID.
Let's take a simple example: we have a workspace with a task table :
A Serenytics dashboard gives you an overview of the progress of your tasks:
We can now use the Assigned to column to filter tasks according to the person to whom they are assigned on the dashboard, in the same way as the "contains the user's Timetonic ID" filter.
To integrate this functionality, we're going to follow 3 steps:
1. Create the filter.
In the "global static filters" section :
- Enter your data source
- Select the column containing the user ID, in our case the column assigned to.
- ==
- {{__userName__}}
Then click on Add to add the filter.
2. Add a test.
In the Test section, enter {"__userName__": "user_id"}
In my case, my id is @lucas, so I'm going to test with: {"__userName__": "lucas"}
At this stage, we can check whether the filter is working:
My dashboard shows 4 "To do" tasks and 2 "Done" tasks for my login.
3. Integrating the dashboard into Timetonic.
To integrate the dashboard, we're going to create a new table .
Then select Smart page :
To find the link to enter in "smart page link", go back to Serenytics and then to "Sharing options".
Finally, choose the "Integrated: integrate the dashboard into your web application with a secure URL" share and copy the link :
Tick the "Send Timetonic user code to Serenytics" box and enter the Serenytics api key.
To find the Serenytics api key, go to your account settings and generate the key:
To finish, click on Add Smart Page.
We now have our dashboard in our Timetonic tables: