Create, view, and manage Superset dashboards with charts and datasets
This skill defines the workflow for creating and managing dashboards in Apache Superset.
Follow these steps in order. Each step depends on the output of the previous one.
write_query) When NeededUse write_query only when you need to run analytical SQL on the source database and materialize the result into Superset's own database.
write_query(sql="SELECT ... FROM source_table ...", table_name="materialized_table_name")
database_id (when resolvable) — save it for Step 2. If not returned, use to find the correct Superset database ID.list_bi_databases()create_dataset)Register a table or SQL query as a Superset dataset.
Physical dataset (table created by write_query or already present in a Superset-connected BI database):
create_dataset(name="materialized_table_name", database_id="<from step 1 or list_bi_databases>")
Virtual dataset (aggregated/transformed view):
create_dataset(name="view_name", database_id="<from step 1 or list_bi_databases>", sql="SELECT ... FROM materialized_table_name")
dataset_id — save it for Step 3.create_dataset.database_id must be a Superset BI database connection ID from write_query or list_bi_databases(). Do NOT assume a source connector ID is valid here.create_chart)Create visualization charts referencing the dataset.
create_chart(
chart_type="bar", # bar, line, pie, table, big_number, scatter
title="Chart Title",
dataset_id="<from step 2>",
metrics="revenue,COUNT(order_id)",
x_axis="date_column",
dimensions="category"
)
Metrics format:
SUM(column): "revenue" -> SUM(revenue)"AVG(price)", "MAX(amount)", "MIN(cost)", "COUNT(id)""revenue,COUNT(order_id),AVG(price)"For big_number charts:
metrics="AVG(activity_count)"x_axis or dimensions needed.create_dashboard)create_dashboard(title="Dashboard Title", description="Optional description")
Returns dashboard_id — save it for Step 5.
add_chart_to_dashboard)add_chart_to_dashboard(chart_id="<from step 3>", dashboard_id="<from step 4>")
Repeat for each chart.
bi-validation)After assembling the dashboard, load bi-validation and verify:
get_dashboardlist_chartsget_chartget_chart_data to confirm it runs without backend errorsDo not report success until this validation pass completes.
| Action | Tool | Notes |
|---|---|---|
| List dashboards | list_dashboards(search="keyword") | Filter by keyword |
| Get dashboard details | get_dashboard(dashboard_id="...") | Full info including charts |
| List charts in dashboard | list_charts(dashboard_id="...") | All charts with config |
| Get chart details | get_chart(chart_id="...") | Full chart definition and query details |
| Get chart data | get_chart_data(chart_id="...", limit=10) | Query result rows for numeric validation |
| List datasets | list_datasets() | All registered datasets |
| List BI databases | list_bi_databases() | Database connections in Superset |
update_dashboard(dashboard_id, title="New Title", description="New desc")update_chart(chart_id, title="...", chart_type="...", metrics="...", x_axis="...", description="...")dimensions or dataset_id was used, recreate the chart instead of relying on update_chart.MUST confirm with user before any deletion.
delete_dashboard(dashboard_id="...")delete_chart(chart_id="...")delete_dataset(dataset_id="...")write_query only when needed to materialize source-side results into a Superset-accessible table.create_dataset — obtain it from write_query or list_bi_databases, not from a source connector.write_query -> database_id -> create_dataset -> dataset_id -> create_chartlist_bi_databases -> create_dataset(... or sql=...) -> dataset_id -> create_chart