Skip to navigation

Swap workbook connections (Beta)

View as Markdown

Swap the connections used by a workbook. You can update custom SQL elements to query a different connection, and optionally swap warehouse tables and copy input table data.

Beta: This documentation describes a public beta feature and is subject to the Beta features disclaimer.

Usage notes

  • Retrieve the workbookId by calling the /v2/workbooks endpoint.

  • Retrieve the connectionId by calling the /v2/connections endpoint.

  • To swap warehouse tables in a connection, set the swapTables option to true. Custom SQL elements and input tables follow the connection mapping whether or not swapTables is set.

    • Use the paths option to specify the connection paths to swap. The connection path is a list of strings that represents the path to the table in the cloud data warehouse. For example, ["database", "schema", "table"].
    • If the table schema is the same in both connections, leave the paths option empty to swap all warehouse tables in the connection. You can also pass a partial path to swap between databases, catalogs, or schemas.
  • Set copyInputTableData to true to copy input table rows onto the new connection. When omitted or false, input table connections are updated without copying row data.

Authentication

AuthorizationBearer

OAuth authentication of the form <token>.

Path parameters

workbookIdstringRequired
Unique identifier of the workbook.

Request

The request body.
connectionMappinglist of objectsRequired
Connections to swap.
copyInputTableDatabooleanOptional
When true, copy input table rows onto the swapped connection. When false or omitted, input table connections are updated without copying row data.

Response

The response body.
unswappedSourceslist of strings
IDs of sources in the workbook that were not swapped.
unswappedConnectionslist of strings
IDs of custom SQL connections in the workbook that were not swapped.