With each new customer, you may have a baseline of connections, datasets, and configurations that you would like to set up in each customer’s workspace. You can accomplish this goal of “Template Workspaces” by composing 2 features — Workspace Variables and Workspace Cloning.

Workspace Variables

Workspace Variables can be set in the Workspace Settings page, and then used in SQL dataset queries, source credentials, and destination credentials. Once set, variables are referenced as {{ application_vars.my_var }}.

Workspace variables must be set prior to their usage.

Setting workspace variables

When creating a workspace variable, you have the option to set it as a secret. Secret workspace variables can only be used within secret fields, such as passwords within connection credentials. They cannot be used in dataset queries. When setting a workspace variable as a secret, the value will be irretrievable after saving. Please ensure you have saved the value in a secure location.

  1. Navigate to the Workspace you’d like to set the variable for.
  2. Click on the “Settings” tab.
  3. Click on the “Admin” tab. Only Organization admins have access to managing workspace variables.
  1. Click “Add Variable”.
  1. If the variable is a secret, check the “Secret” checkbox.
  2. Enter the name and value of the variable.
  3. Click “Save”.

Using workspace variables in SQL datasets

  1. Navigate to the Dataset you’d like to use the workspace variable in.
  2. Click on the “SQL” editor.
  3. Reference the variable as {{ application_vars.my_var }}.

Using workspace variables in connection credentials

  1. Navigate to the connection you’d like to create via the Sources or Destinations tab.
  2. Click on the “(Advanced) Edit as JSON” button. Workspace variables can only be used in this JSON mode. Note: Only organization admins have access to using variables in connection credentials.
  1. Reference your variables using the {{ application_vars.my_var }} syntax.

Workspace variables can be used in source and destination connections. For destination connections, variables are currently only supported for Census-built credentialed connections. This excludes any Custom Destinations, HTTP Destinations, or destinations that require OAuth to connect. Please reach out if you need to use variables in one of these unsupported destinations.

Workspace Cloning

Workspace Cloning allows you to create a new workspace based on an existing one. This is useful for spinning up new workspaces that have the exact same connections and datasets, or have resources that differ slightly by a workspace variable value.

Workspace Cloning clones the following resources into a new workspace

  • SQL datasets and their relationships
  • Warehouse managed audiences
  • Source connections
  • Destination connections
  • Datadog integrations

The following resources are not yet supported for cloning. Please contact support if you’d like to be able to clone

  • Syncs
  • Segments
  • Computed columns and column annotations
  • Non-SQL datasets (Dbt, Looker, Python, Sigma)

By default, cloning a source will not preserve any Census-generated credentials. This includes credentials like the Athena external ID for connections using Role-based authentication, Census-managed Google service accounts for BigQuery and Google Sheets, and others.

If you’d like to preserve these sorts of credentials on clone, please reach out to us at support@getcensus.com and we’ll enable this for you.

Cloning a Workspace with Workspace Variables

When cloning a workspace, you can specify new values for the workspace variables that are used in the cloned workspace’s resources.

  1. Navigate to the Organization Dashboard.
  2. Click on the “Workspaces” tab.
  3. Click the three dot button on the workspace you’d like to clone, and click Clone.
  1. Enter the name of the new workspace.
  2. Enter values for the new workspace’s variables.
  3. Click “Save”.