How do you overwrite a default value in a link to a dashboard?

Knowledge Drop

Last tested: May 2020

If you have a default value set for a dashboard filter, then the usual method of setting dashboard filter values by URL does not work in all cases. For example, if you set the dashboard filter to the empty string like so:

/dashboards/8?FilterA=&FilterB=

Then Looker will overwrite this empty string with the default value.

Instead, you need to add in a space character, known in HTML as %20. It doesn't cause the query to search for a space, but it does force the default value to be empty.

/dashboards/8?FilterA=%20&FilterB=

Note: This will default the filter type to is equal to. If you want to change that, you can mess with the filter_config part of the dashboard, which you can find in the back half of the Looker-generated URL. You will want to use an URL decoder to help you change the values. In this example, to change the filter type to contains, you would do:

dashboards/8?filter_config%3D%7B%22FilterA%22%3A%5B%7B%22type%22%3A%22contains%22%2C%22values%22%3A%5B%7B%22constant%22%3A%22%22%7D%2C%7B%7D%5D%2C%22id%22%3A2%7D%5D%7D

Decoded, the filter_config is an array. Notice we're putting contains as the type and "" as the value.

?filter_config={"FilterA":[{"type":"contains","values":[{"constant":""},{}],"id":2}]}

This content is subject to limited support.                

Version history
Last update:
‎04-05-2021 09:00 AM
Updated by: