Reputation: 53
I have a dashboard in Looker which contains a button that is a url that goes to another look with more granular data than the dashboard. What I want to do is change the url params of this button based on what the user chooses in the filters on the dashboard. Anyone have any ideas?
Upvotes: 0
Views: 2382
Reputation: 1
You can use liquid variables in the URL of the button. There's a specific section on passing filter values.
The tricky part here though, is that the button will need to be based on a query result for this to work. Static text/markdown Dashboard elements do not support liquid, and so you need to have a single value chart that acts as the 'button'. The single value chart will be based on the Explore containing the fields used in the dashboard filters, so that their values are accessible by the liquid.
The easiest way to do this is probably via a dummy dimension, that just selects a string:
dimension: button {
sql: 'Button'
link: {
label: "My Link"
url: "/look/<1234>?f[destination_view_name.field_name]=_filters['view_name.field_name']"
}
}
Where 1234 is the ID of your look, destination_view_name.field_name is the fully scoped field name for the filter in the Look you are linking to, and view_name.field_name is the name of the Explore and field being filtered on in the Dashboard (that you want to carry through to the Look).
Upvotes: 0