Change the data source for a workbook, data model, or element
You can change the data source used by an entire workbook or data model, or change the data source used by a specific data element. When changing the data source for a document or element, you can change to a different connection, or change to a different data source in the same connection, such as sourcing data from another table in the same warehouse.
For example, you might build a workbook with data sources from a test data connection to reduce load on a production database while you experiment and create calculations. When you're ready to publish and share the workbook with your team or organization, you can replace the test data sources used by the workbook with production data sources.
You can also swap the data source of a workbook or data model automatically, based on the version tag. See Swap the source of a tagged version.
Requirements
- You must be granted Can use access to the connection that you want to change to.
- You must have Can edit or Can explore access to the document.
- To change the connection used by an input table, the connection you change it to must have Write access enabled. See Set up write access for more information.
Considerations
- When changing the source of a data model, consider the potential to create breaking changes in documents that use that data model as a source. For example, changing the source of a table in a data model might change the available columns, column names, or data types, causing errors in downstream columns. For more information on preventing breaking changes when updating a data model, see Map changed columns in a data model.
- When changing the connection used by an input table, a copy of the input table is created on the new connection. Although the data in the input table is copied to the new connection, the new input table has a separate write-ahead log in the write-back schema, and appears as a new input table in the document's version history.
Limitations
When changing the connection used by a document that contains input tables, the following limitations apply:
- The connection type must match. For example, you cannot change from a Snowflake connection to a Databricks connection.
- You must change the connection for all input tables in a document. You cannot change the connection for some input tables without changing others.
- You cannot change the connection used by a linked input table.
Change the data source for a workbook or data model
You can change the data source for all elements in a workbook or data model, such as when changing from a test connection to a production connection, by doing the following:
-
Open the document in Edit or Explore mode.
-
From the document menu
, select Edit > Swap data sources….
-
In the Swap data sources and input table connections modal, review the automatic selection for each connection and element under Swap to. If needed, update the selected connection or data source. If you're changing the connection used by an input table, select a connection of the same type as the Current connection.
-
Review the data sources shown for each element in the document under Swap to. If No match is listed for an element, select Match manually to choose a different data source for each element without a matching data source.
-
On the manual match page, select a data source used by an element, then click Select Source.
-
Search for or browse to a new data source, then click Select.
-
Select the next data source that needs to be matched and repeat these steps.
-
After all data sources without matches have been matched to a new data source, select Swap.
-
-
If your document contains an input table and the connection you are swapping to has multiple write-back schemas, in the Recreate in section, select the write-back schema in which to create the new input table.
-
After reviewing the changes, select Swap now.
The document updates to use the new data source. Any elements without matching data sources display an error.
Some elements have additional considerations when changing their data source:
- If your document contains custom SQL elements, the data source and connection for those elements is not changed. Instead, you must create a new SQL element and write equivalent SQL against the new data connection.
- If your document contains a table created from a CSV upload, you cannot change the source of the table.
Change the data source for an element
You can also change the data source used for a specific element. For example, if you created a view in your Snowflake database and you want to update a Sigma table element to use the view instead of the base table from the Snowflake connection, you can change the source.
You cannot change the data source for an element that uses Custom SQL to directly query the connected data warehouse. If you change the source for a SQL element, the element no longer uses SQL.
Swap the data source for an element
After selecting an element while customizing or editing, you can change the data source:
- From the canvas, select
More > Element source > Change source. Or, on the Properties tab of the editor panel, locate the name of the data source and select
> Change source.
- Search for or browse to a new data source for the element.
- [optional] Preview the data source to choose specific columns, then click Add.
- Select the data source to finish changing the data source.
The data element updates. If your element contains a calculated column that references a column that does not exist in the new data source, the calculated column displays "unknown column".
Replace the table used by a table element
If you want to replace the table used by a table or pivot table element with a different table, do the following:
- From the canvas, select
More > Element source > Replace table. Or, on the Properties tab of the editor panel, locate the name of the data source and select
> Replace table.
- Search for or browse to a new table for the element.
- Review the selected columns and optionally deselect the checkboxes next to any unwanted columns.
- Click Add.
The data element updates. If your table contains a calculated column that references a column that does not exist in the new table, the calculated column displays "unknown column".
Swap the connection used by an input table
This feature isn't supported by all data platform connections. To check if your connection supports it, see Supported data platforms and feature compatibility.
You can change the connection used by a document that contains an input table to another connection with Write access enabled. When you change the connection used by an input table, a copy of the input table and its data are created on the new connection. For example, you might want to change the source of an input table from a test connection to a production connection after configuring it with the appropriate columns and testing it with sample data.
To change the connection used by an input table, follow the steps in Swap the data source for a workbook or data model, and select a connection of the same type as the Current connection for the input tables in the document. For important information on changing the data source of a document that contains an input table, see Limitations.
Updated 5 days ago
