Knowledge Drop

Can I update my dashboard with a new custom slug using update_dashboard?


Last tested: Feb 10, 2021
 

Yes, we can update the dashboard with a custom slug but please note dashboard slugs are required to be 22 characters long.

If we try to use the update_dashboard endpoint with a slug that's less than 22 characters, we'll see the following error message.

 

# Node SDK

const dashboard = await lookerSDK.ok(lookerSDK.dashboard("123"))

const test = await lookerSDK.update_dashboard("123", {slug: "slugtest"});

# Results in this error

error: {

message: 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined',

type: 'sdk_error'

},

 

This content is subject to limited support.                

 

 


2 replies

Is there an explanation somewhere of why the slugs need to be exactly 22 characters? This seems arbitrary yet specific

Just in case someone else stumbles across this, i had to import dashboards into a shared folder with an explicit slug:

 

# Python SDK - import dashboard and save it as a variable

dashboard = sdk.import_lookml_dashboard(lookml_dashboard_id=”dashboard_id_here”, space_id=”folder_id_here”)

#change the vaiable dasboard - slug property

dashboard.slug = “new_slug_here”

#update the imported dashboard with the new slug

sdk.update_dashboard(dashboard_id=dashboard.id, body=dashboard)

Reply