It may be desired to fix a filter to certain values so that the dashboard shows only that specific data when opening it. This is possible by using filter initialization option. As explained in this article you can set up such filter initialization from inside the editor or on the token.

Setting this up via the token allows you to set a different selection based on the specific user looking at the dashboard. This may be particularly interesting when the values available are different per user.

In case you'd like to initialize a Slider filter dynamically based on the end-user looking at the integrated dashboard, you can specify the initialization filter in the authorization request and use the received authorization key and token to embed the dashboard.

For a Slider filter, you should provide two filter objects where one initializes the lower boundary and the other initializes the upper boundary. Depending on whether you've used a Datetime column or a Numeric column in the slider, you should initialize it with the correct value!

This Developer documentation guide shows the complete authorization request needed to initialize a certain widget.

Initializing a Slider filter with Datetime values

{
  "clause": "where",
    "chart_id": "< chart id of a filter object contained in the dashboard >",

  "expression": "? >= ?",
  "value": "2019-01-01T00:00:00.000Z"
},
{
  "clause": "where",
    "chart_id": "< chart id of a filter object contained in the dashboard >",
  "expression": "? <= ?",
  "value": "2019-12-31T23:59:59.999Z"
}

Important note: As you will be specifying the time in the Zulu format, please ensure that the time on the token is offset to match the one in the dashboard. For example, if the time in your dashboard is set to "UTC+2", you will need to subtract 2 hours from the time you want to set on the dashboard, specifying "2024-30-01T22:00:00.000Z" instead of "2024-31-01T00:00:00.000+02:00".

Initializing a Slider filter with Numeric values

{
  "clause": "where",
  "chart_id": "< chart id of a filter object contained in the dashboard >",
  "expression": "? >= ?",
  "value": 12
},
{
  "clause": "where",
  "chart_id": "< chart id of a filter object contained in the dashboard >",
  "expression": "? <= ?",
  "value":30
}

Clearing initialization filter specified in the dashboard editor

{
  "origin": "clear",
  "chart_id": "<chart_id_of_filter_widget_to_be_cleared>"
}

Need more information?

Do you still have questions? Let us know how we can help.
Send us feedback!