Dashboard API widget config fails to update after ERP schema changes

After our ERP underwent a schema update, dashboard widgets using the Snowflake 7.0 dashboard API stopped updating properly. The API calls succeed (200 OK), but widgets display stale data or “Schema Error” messages.


PUT /api/v1/dashboards/widgets/sales_summary
{
  "dataSource": "erp_sales",
  "fields": ["revenue", "units_sold", "region"]
}
// Returns: 200 OK, but widget shows: "Schema Error: Field 'revenue' not found"

The ERP schema change renamed ‘revenue’ to ‘total_revenue’. We’ve updated the widget config via API, but schema cache invalidation doesn’t seem to be happening. How do we force API metadata sync after schema changes?

Solved! The issue required addressing all three areas - schema cache invalidation, widget config update, and API metadata sync:

1. Schema Cache Invalidation: Force schema refresh for the data source:


POST /api/v1/datasources/erp_sales/refresh-schema
{
  "forceCacheInvalidation": true,
  "propagateToCluster": true
}

The forceCacheInvalidation flag is critical - without it, cached schema persists.

2. Widget Config Update: After schema refresh, verify metadata and update widgets:


// Verify new schema is visible
GET /api/v1/datasources/erp_sales/metadata
// Confirms: "total_revenue" field now present

// Update widget with new field names
PUT /api/v1/dashboards/widgets/sales_summary
{
  "dataSource": "erp_sales",
  "fields": ["total_revenue", "units_sold", "region"],
  "forceRefresh": true
}

3. API Metadata Sync: Wait for cluster-wide propagation (5-10 minutes) or check sync status:


GET /api/v1/datasources/erp_sales/sync-status
// Returns: {"syncComplete": true, "lastSyncTime": "2025-06-11T13:15:00Z"}

Key discovery: Widgets using templates required template updates first:


PUT /api/v1/dashboards/templates/sales_template
{
  "fields": ["total_revenue", "units_sold", "region"]
}

// Then re-instantiate widgets from updated template
POST /api/v1/dashboards/widgets/from-template
{
  "templateId": "sales_template",
  "widgetId": "sales_summary"
}

Without forceCacheInvalidation: true and propagateToCluster: true, schema refresh was only partial. Also, template-based widgets ignore direct widget updates - always update templates first. After following this sequence, all widgets now display correct data with updated field names.

Tried the schema refresh endpoint, but still getting schema errors. The refresh call returns success, but widgets continue showing old field names. Is there a propagation delay, or do I need to update something else?

Consider adding a validation step before updating widgets. After schema refresh, query the metadata endpoint to verify new fields are visible: GET /api/v1/datasources/erp_sales/metadata. This shows you what fields Snowflake currently sees, helping you confirm the schema cache has actually updated before attempting widget updates.

Widget config update requires two steps after schema refresh. First, refresh the schema as Laura mentioned. Second, you must explicitly update each widget’s field mappings using the widget update API. Just refreshing the schema doesn’t automatically remap widget fields - you need to send updated field names in the PUT request.