Using actions in custom visualization to change query of the dashboard

Hi community!
I was digging the Looker community forum and documentation (also the one regarding Visualization API on gihub.com) and I could not find any information on the possibility of interacting with the dashboard query by action done within custom visualization. How I imagine it:
by clicking certain button in my custom visualization I am able to apply filters on the query for whole dashboard (not only for given visualization). Is something like this possible?

Thanks in advance for your answers!

B.

0 2 734
2 REPLIES 2

Hi Biggie,

I found this article on creating a hyperlinking button.

If you want to create a button that changes filters, I have managed to make that work. In the code below, you have to remove the four “-” characters, I had to put those in so that the text does not get reformatted. Next, replace “DashId” with your dashboard’s id, and add the filter conditions that you want to set up.

dimension: button_1 {
sql: ${TABLE}.Id ;;
html: <-a href="/dashboards/DashId?Filter%20Name=FilterValue"><-button>Load Custom Filters<-/button><-/a>
;;
}

I would suggest adding this dimension to a view that only has a few rows, that way, you don’t have to query a big table only to show one button.

Screenshot 2020-06-10 at 17.37.31 This is how it looks in the dashboard.

If you have trouble writing the filter conditions in the URL, look to your own URL for the solution!

Hope this helps,
Jasper

Hey Jasper,

your answer is ultra insightful, thank you for that. Yesterday I spoke with Tim from the customer love department and we came into conclusion, that this issue should be flagged as “related to cross-filtering using custom visualization”. This truly answers my question asked above and it works perfectly as a workaround to what Tim told me.

Thanks once again!

B.

Top Labels in this Space