cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Use API to Clone Dashboards with Widgets in Databricks SQL?

bl12
New Contributor II

Hi, I manually created a template dashboard with one widget. I wanted to clone this dashboard using the Create Dashboard API however I don't know what to put for the widget object. What I did was use the Retrieve API on the template dashboard, and then copied the widget information to Create Dashboard API. But this just made a new dashboard with no widgets so how do you clone the widget too using the API?

Additionally, if it's possible to do that, would I be able to change the underlying query powering the widget on the cloned dashboard in the Create API?

https://docs.databricks.com/sql/api/queries-dashboards.html#operation/sql-analytics-create-dashboard

1 ACCEPTED SOLUTION

Accepted Solutions

User16752242622
Valued Contributor

Hi @Belle Lโ€‹ 

Please try submitting a POST request to /api/dashboards/{dashboard id}/clone API

with a JSON request body like so:

{"name": "<desired name of new dashboard>"}

I believe, this way you can have a duplicate of the existing dashboard and widgets.

This is not documented yet. We have an internal ticket on this API to update the document.

Hope this helps!

Best,

Akash

View solution in original post

2 REPLIES 2

User16752242622
Valued Contributor

Hi @Belle Lโ€‹ 

Please try submitting a POST request to /api/dashboards/{dashboard id}/clone API

with a JSON request body like so:

{"name": "<desired name of new dashboard>"}

I believe, this way you can have a duplicate of the existing dashboard and widgets.

This is not documented yet. We have an internal ticket on this API to update the document.

Hope this helps!

Best,

Akash

Wout
Contributor

@Akash Bhatโ€‹ how do I clone a dashboard across workspaces? Being able to deploy dashboards (with widgets!) through the API is essential to set up proper Data Engineering workflows.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group