Question

Dynamically changing Connection


Hi,

I would like help with a problem that I have.

Let us say that I have 10 database connections and I have dashboard for each of these. Dashboards are exact copies except database connection (and of-course data is different for them). So I have 10 different dashboards, what I want to do is to have only 1 dashboard and user should be able to select what system(connection) they want to see and the dashboard dynamically changes connection to get the data for whatever system/connection user selects. I do not want to bring all data to one database/system to get this done.


Thanks


6 replies

Userlevel 3

Hey @ima.adesi,


It’s not currently possible for users to select different connections for tiles on a dashboard to use, but I’ll let our product team know that this would be a useful feature for you! One potential workaround would be to have a master dashboard with a text tile that links to each of the other ten dashboards (you can see the syntax for this here).

I see the use in this also, particular for a support/monitoring instance we’re planning to set up. Would be good to be able to easily flit between the 25 connections we have for each of our customers.


@ima.adesi if your dashboard is a LookML dashboard, you can use something along these lines to maintain one dashboard definition, that generates a different dashboard based on the different models/connections you have set up. It doesn’t solve the problem, but makes maintenance much easier when you need to update anything on the dashboard:



Thanks, I am currently using links like you suggested so that users can easy access them but my issue here is that I am trying to solve two issues

1)Having too many dashboards with exact same thing

2)Then the issue of maintaining them

Thanks, each of my dashboards has 10 to 15 individual charts/graphs. currently what I do is to make changes to one and then copy the lookml to a text editor and then globally replace connection and then save as different dashboard. I do this for every connection, so I have to do 10 global replaces. Is there an easy way to do this?

Yes, depending on how your lookml is modeled.


Our solution is:


Store one copy of this as a lookml dashboard, we save these template dashboards as “common.dashboard_name”.


If you’re using the GUI to generate your dashboard LookML, remove the “model” parameter from each of your individual elements.


We also have all of our communal views named in the same format, so the dimensions and measures you hope to access across all connections are in "common.view_name"


We have a model.base.lkml file that we created which contains all of the necessary explore definitons, we do not include connection name here.


You would then have a different model for each of your connections e.g. we have a customer1, customer2 model, In each of these model files we have at the top:


connection: "customer_connection_name"

include: "model.base.lkml"

include: "common.*.dashboard"

include: "common.*.view"


This will then create a separate dashboard for each of your connections from this dashboard template file. This use case works well for us because it means we can also easily add some dashboards only for certain customers, and the same with extra dimensions and measures. We do this by e.g. naming a dashboard “customer1.dashboard_name” and a view (if necessary) “customer1.view_name” and then we also add to the top of that model:


include: "customer1.*.view"

include: "customer1.*.dashboard"


This won’t work for everyone, but is a great solution for our use case, hope it gives you some ideas!

Are there any updates on this? I see the last update was in 2018.

Reply