Question

Dynamically/Real-time Create Dashboard

  • 8 November 2015
  • 3 replies
  • 494 views

I’d like to have some dashboards (maybe from a template) on the fly. Is this possible?


Use case - I have clients that all use the same basic dashboards and region maps (US States & Counties). I can’t display all 50 states and 4000 counties besides the my clients may only a few states. So, I’d like to display a table of measures by state with a link to the state/county dashboard.


See the image below. I’d rather not create 50 dashboards (1 for each state).



3 replies

Hi Sonny,


This is a super interesting use case! Our next release is debuting new interactive maps that use lat/lon data. They add the ability to pan and zoom based on the data, similar to what you described.


This new mapping feature, currently, only works with lat/lon data, but having it work with regional data is within the realm of possibility for the future. I will gladly bring this up this request with engineering.


In the meantime, all the custom map preferences show up in the url parameters for a given Look. Using [custom html drilling] ([Retired] Custom Drill Using HTML and Query Parameters), you could potentially dynamically link to a look that has the pre-determined map preferences in the url (as you mentioned that you wanted to do with a dashboard).


Here is a template of a url you would link to in the custom url drill:


https://your_looker.url.here/explore/model/explore_name?fields=view.field_1,view.field_2,view.field_3&f[view.filter_1]={{ value }}&pivots=view.field_2&vis={"type":"looker_geo_choropleth","show_view_names":true,"map":"topojson","map_projection":"","quantize_colors":false,"stacking":"","show_value_labels":false,"label_density":25,"legend_position":"center","x_axis_gridlines":false,"y_axis_gridlines":true,"y_axis_combined":true,"show_y_axis_labels":true,"show_y_axis_ticks":true,"y_axis_tick_density":"default","y_axis_tick_density_custom":5,"show_x_axis_label":true,"show_x_axis_ticks":true,"x_axis_scale":"auto","ordering":"none","show_null_labels":false,"map_url":"MAP_URL_HERE","map_property_key":["PROPERTY_KEY_HERE"],"loading":false}">{{ value }}</a>

When creating your url, I would create an example Look and then use that url as a foundation. In addition, it is important for the map url parameter (i.e. the URL that links to your custom topojson) to be a consistent pattern so you can link dynamically to the map using liquid html.


I hope that helps! Please feel free to reach out via chat or help.looker.com if you have additional questions.


I also encourage you to check out the new maps functionality here when you get a chance!


Cheers,

Alejandro

This sounds like a good approach. I’ll give it a go. In the meantime, I have a python script that generates the 50+ LookML dashboards (along with other widgets on dashboards). It appears to be working just fine but a bit of a hassle.


Thanks for your help.

@srae-1641238188  can you please help me with the python script , how do you generate lookml dashboard .
Actually I want to do automation for my migration dashboard 

Reply