Setting up filters
This section will walk you through adding filters to your data sources or to set up customizable filter bars in your dashboards
Setting up filters in data sources
Filters in data sources allow you to filter out your dataset based on a value, user parameter, dates or session parameters (Session parameters will be used to set up filters on your dashboard)
1. Filtering by a fixed value
You can set up a static filter by clicking on Add new filter
and then setting up your filtering criteria. You would do this by selecting the column you want to filter, the operator you want to perform and the value you want to filter by.
You can set up multiple filters for a datasource and a row of data will only be shown if it satisfies all the criteria listed.
2. Filtering by an embed user parameter
You can set up an embed filter by clicking on Add new filter
and then setting up your filtering criteria. You would do this by selecting the column you want to filter, the operator you want to perform and the embed user value you want to filter by. You will have to set it up using {{user.<parameter-name>}}
.
Onvo already passes in the user id, email and name but you can also add your own user parameters by following this tutorial. If you are using a custom embed user parameter, be sure to set up a default value in the parameters section.
You can also filter by static values alongside user parameters.
3. Filtering by a session parameter
You can set up a session filter by clicking on Add new filter
and then setting up your filtering criteria. You would do this by selecting the column you want to filter, the operator you want to perform and the session value you want to filter by. You will have to set it up using {{session.<parameter-name>}}
.
You can set up custom session parameters by following this tutorial. Make sure to set up a default value for each session parameter in the parameters section.
You can also filter by static values and embed user parameters alongside session parameters.
List of all default parameter values
You can find a list of all the default parameters values on the sidebar on the right hand side of the page.
Setting up filters in dashboards
Now that you have learnt how to set up filters on the dashboard, let's extend that to allow users to edit the data they see. To do this, first setup at least one session parameter on a data source.
You can then head to a dashboard that has the particular data source linked, click on Settings
in the top right corner and click on Enable filters
in the Embed UI settings
section. You will now see a new section called Dashboard Filters
.
Here, you can click on Add filter
and fill out the form to add a single filter. You can add as many filters as you want to a dashboard and data will only be shown if it passes all these filter rules.
Remember that the filters here will pass the data to the session parameters that you set up early on. Once you are happy, click on Save
on the page footer and the new filter bar should appear on your dashboard.