How to build a dynamic link parameter for different dashboard ID between dev and production environments

Knowledge Drop

Last Tested: Jun 25, 2020

Problem

Using relative links (/dashboards/410) vs. absolute links (https://abcdefg.looker.com/dashboards/410) will correct for differences in the base domain, but will not accommodate for differences in dashboard ID between dev and production instances.

Solution

If a dashboard was moved from one instance to another using Gazer, the dashboard ID may be different, but the dashboard slug will remain the same. So we can use the slug in place of the id directly in the link.

For example you can do gzr dashboard cat 410 --host myinstance.looker.com and get:

{

"content_metadata_id": 2997,

"description": "This is Katie's cool dashboard",

"hidden": false,

"id": 410,

"query_timezone": null,

"readonly": false,

"refresh_interval": null,

"refresh_interval_to_i": null,

...

"favorite_count": 0,

"last_accessed_at": "2019-06-28 15:23:00 +0000",

"load_configuration": "cache_run",

"lookml_link_id": "girls_at_looker::WB_TEST",

"show_filters_bar": true,

"show_title": true,

"slug": "KoDXRuaeLDQCuQ0rt4iHQN",

"space_id": 1132,

"text_tile_text_color": "",

"tile_background_color": null,

"tile_text_color": "#bf2a67",

"title_color": "#1488b5",

"view_count": 3,

"content_favorite_id": null,

"model": null,

"deleted": false,

"last_viewed_at": "2019-06-28 15:23:00 +0000",

...

}

and then use /dashboards/KoDXRuaeLDQCuQ0rt4iHQN to access this dashboard instead of /dashboards/410

*please note this doesn't work for looks - there's a feature request here feedback.us.pendo.io/app/#/case/38314

Comments
sri75
Participant III

Hi,

Thanks for the info

Mahesh2
Explorer

@jonallen , I could see slug is different when we moved dashboard manually through the Lookml dashboard.  Can you please help me to fix it :

stage → preferred_slug: 1a93QB1k3*******36

prod → preferred_slug: 2b78QB1k3*******01

Version history
Last update:
‎04-05-2021 03:32 PM
Updated by: