Connect to Data

Tableau Prep helps you clean and shape your data for analysis. The first step in this process is to identify the data you'll work with.

Note: Starting in version 2020.4.1, you can also create and edit flows in Tableau Server and Tableau Cloud. Information in this topic applies to all platforms, unless specifically noted. For more information about authoring flows on the web, see Tableau Prep on the Web(Link opens in a new window) in the Tableau Server help.

You can connect to your data using any of the following:

The most common way to connect to data is to use the built-in connectors in Tableau Prep Builder. These are available for most popular data types, and new connectors are added frequently with new versions of Tableau Prep Builder. For a list of available connectors, open Tableau Prep Builder or start a flow on the web, then click the Add connection button to see available connectors listed under Connect in the left pane.

Most built-in connectors work the same across all of our platforms and are described in the Supported Connectors(Link opens in a new window) topic in the Tableau Desktop Help.

Note: When connecting to a data source, don't use the reserved name "Number of Records" for a field name or a calculated field. Using this reserved name will result in a permission-related error.

Considerations when using built-in connectors

  • If you open a flow in a version where the connector isn't supported, the flow may open but might have errors or won't run unless the data connections are removed.

  • When using a MySQL-based connector, the default behavior is that the connection is secure when SSL is enabled. However, Tableau Prep Builder does not support custom certificate-based SSL connections for MySQL-based connectors.
  • Some connectors, detailed in the sections below, have different requirements when using them with Tableau Prep Builder.

Connect to cloud data sources via Tableau Server or Tableau Cloud
Connect to Salesforce data
Connect to the Salesforce Data Cloud
Connect to Google BigQuery data
Connect to SAP HANA data
Connect to Spatial files and databases
Connect using ODBC
Connect to Microsoft Excel data and clean with Data Interpreter

Connect using custom connectors

When Tableau Prep doesn't provide a built-in connector for your ODBC- and JDBC-based data, you can use a custom connector. You can:

Custom connectors for ODBC- and JDBC-based data are supported in Tableau Prep Builder version 2020.4.1 and later.

For connector developers, see Run Your Connector for more information.

Some custom connectors require the installation of an additional driver. If prompted during the connection process, follow the prompts to download and install the required driver. Custom connector currently cannot be used with Tableau Cloud.

Use partner-built connectors

Partner-built or other custom connectors are available from the Connect pane. These connectors are listed under Additional Connections and are also available from the Tableau Exchange connectors page.

  1. Click Connections in the left pane.
  2. From the Additional Connectors section in the Connect pane, click on the connector you want to use.
  3. Click Install and Restart Tableau.

    After the connector is installed, it appears in the To a Server section of the Connect pane.

Note: If you receive a warning that the connectors can’t load, install the .taco file you need from the Tableau Exchange connectors page. If you are prompted to install the drivers, go to Tableau Exchange for driver download instructions and locations.

Connect to published data sources

Published data sources are those you can share with others. When you want to make a data source available to other users, you can publish it from Tableau Prep Builder (version 2019.3.1 and later) to Tableau Server or Tableau Cloud, or as output from your flow.

You can use a published data source as an input data source for your flow, whether you are working in Tableau Prep Builder or on the web.

Note: When you publish a flow that includes a published data source as an input, the publisher is assigned as the default flow owner. When the flow runs, it uses the flow owner for the Run As account. For more information about the Run As account, see Run As Service Account(Link opens in a new window). Only the Site or Server Administrator can change the flow owner in Tableau Server or Tableau Cloud and only to themselves.

Tableau Prep Builder supports:

  • Published data sources with user filters or functions starting in Tableau Prep Builder version 2021.1.3.
  • Connections to a single server and site. Logging into a different server or the same server and different site isn't supported. You must use the same server or site connection to do the following:
    • Connect to the published data source.
    • Publish flow output to Tableau Server or Tableau Cloud.
    • Schedule the flow to run on Tableau Server or Tableau Cloud.

    If your flow uses published data sources and you sign out of the server, this breaks the flow connection. The flow will be in an error state and you won't be able to see the data from the published data source in the profile pane or data grid.

Note: Tableau Prep Builder does not support published data sources that include multi-dimensional (cube) data, multi-server connections, or published data sources with related tables.

Tableau Server and Tableau Cloud supports:

  • Published data sources with user filters or functions starting in Tableau Server and Tableau Cloud version 2021.2.
  • Creating or editing a flow on the web using a published data source (Tableau Server or Tableau Cloud version 2020.4 and later)
  • Connecting to published data sources (Tableau Server and Tableau Cloud version 2019.3 and later)

    Note: Earlier versions of Tableau Server may not support all features of the published data source.

About credentials and permissions:

  • You must be assigned a role of Explorer or higher in the server site where you are signed in to connect to published data sources. Only Creators can create or edit flows on the web. For more information about site roles, see Set User's Site Roles(Link opens in a new window) in the Tableau Server help.
  • In Tableau Prep Builder, data source access is authorized based on the identity of the user signed into the server. You will see only the data to which you have access.
  • In Prep web authoring (Tableau Server and Tableau Cloud), data source access is also authorized based on the identity of the user signed into the server. You will see only the data to which you have access.

    However, when you run the flow manually or using a schedule, data source access is authorized based on the identity of the flow owner. The last user to publish a flow becomes the new flow owner.

  • Site and Server Administrators can change the flow owner, but only to themselves.
  • Credentials must be embedded to connect to the published data source.

    Tip: If credentials aren't embedded for the data source, update the data source to include the embedded credentials.

Using published data sources in your flow

To connect to a published data source and use it in your flow, follow the instructions for your Tableau Prep version:

Tableau Prep Builder version 2020.2.2 and later and on the web
Tableau Prep Builder version 2020.2.1 and earlier

Connect to Virtual Connections

Supported in Tableau Prep Builder version 2021.4.1 and later and in Tableau Server and Tableau Cloud version 2021.4 and later. Data Management is required to use this feature.

You can connect to data using virtual connections for your flows. Virtual connections are a sharable resource that provides a central access point to data.

Considerations when connecting to virtual connections:

  • Database credentials are embedded in the virtual connection. You only need to sign into your server to access the tables in the virtual connection.
  • Data policies that apply row-level security can be included in the virtual connection. Only tables, fields, and values you have access to are shown when working with and running your flows.
  • Row-level security in virtual connections does not apply to flow output. All users with access to the flow output see the same data.
  • Custom SQL and Initial SQL are not supported.
  • Parameters are not supported. For more information about using parameters in your flow, see Create and Use Parameters in Flows.

For more information about virtual connections and data policies, see the Tableau Server(Link opens in a new window) or Tableau Cloud(Link opens in a new window) help.

  1. Open Tableau Prep Builder and click the Add connection button.

    In web authoring, from the Home page, click Create > Flow or from the Explore page, click New > Flow. Then click Connect to Data.

  2. On the Connect pane, under Search for Data, select Tableau Server.

  3. Sign in to connect to your server or site.

    In web authoring, the Search for data dialog opens for the sever you are signed into.

  4. Click Type All.

  5. Select Virtual Connections.

  6. Select the data source you want to use, then click Connect.

  7. The data source is added to the Flow pane. In the Connections pane, you can select from the list of tables included in the virtual connection and drag them to the flow pane to begin your flow.

Note: If you see Rename operations in the Changes pane when connecting to a virtual connection, do not remove them. Tableau Prep auto-generates these operations to map to and display the field's user-friendly name.

Connect to Tableau data extracts

You can connect to a data extract as input to your data flow. Extracts are saved subsets of data that you can create by using filters and configuring other limits. Extracts are saved as .hyper files.

For more information on using extracts with Tableau Prep Builder, see Save and Share Your Work.

Connect to data via Tableau Catalog

If you have the Data Management(Link opens in a new window) with Tableau Catalog enabled, you can also search for and connect to databases, files, and tables stored on Tableau Server or Tableau Cloud.

For more information about Tableau Catalog, see "About Tableau Catalog" in the Tableau Server(Link opens in a new window) or Tableau Cloud(Link opens in a new window) Help.

Other connection options

When you connect, you may also see the following options, depending on which connection you choose.

Use Custom SQL to connect to data

If you know exactly the information you need from a database and understand how to write SQL queries, you can use custom SQL queries to connect to data just like you can in Tableau Desktop. You can use custom SQL to union your data across tables, recast fields to perform cross-database joins, restructure or reduce the size of your data for analysis, and so on.

  1. Connect to your data source, and in the Connections pane, in the Database field, select a database.

  2. Click the Custom SQL link to open the Custom SQL tab.

  3. Type or paste the query into the text box and then click Run to run your query.

  4. Add a clean step in the flow pane to see that only relevant fields from the custom SQL query are added to your flow.

Use Initial SQL to query your connections

Supported in Tableau Prep Builder version 2019.2.2 and later and when authoring flows on the web starting in version 2020.4.1

You can specify an Initial SQL command that will run when a connection is made to a database that supports it. For example when connecting to Amazon Redshift, you can enter a SQL statement to apply a filter when connecting to the database just like adding filters in the Input step. The SQL command will apply before data is sampled and loaded into Tableau Prep.

Starting in Tableau Prep Builder (version 2020.1.3) and on the web, you can also include parameters to pass application name, version and flow name data to include tracking data when you query your data source.

Run Initial SQL

To refresh your data and run the Initial SQL command do one of the following:

  • Change the Initial SQL command and refresh the Input step by re-establishing the connection.
  • Run the flow. The Initial SQL command is run before processing all of the data.
  • Run the flow on Tableau Server or Tableau Cloud. The Initial SQL is run every time that the flow is run as part of the data loading experience

Note: Data Management(Link opens in a new window) is required to run your flow on a schedule on Tableau Server or Tableau Cloud. For more information about the Data Management, see About Data Management(Link opens in a new window).

  1. In the Connections pane, select a connector in the list that supports Initial SQL.
  2. Click the Show Initial SQL link to expand the dialog and enter your SQL statements.

Include parameters in your Initial SQL statement

Supported in Tableau Prep Builder version 2020.1.3 and later and when authoring flows on the web starting in version 2020.4.1.

You can pass the following parameters to your data source to add additional detail about your Tableau Prep application, version and flow name. The TableauServerUser and TableauServerUserFull parameters are not currently supported.

Parameter Description Returned value
TableauApp The application being used to access your data source.

Prep Builder

Prep Conductor

TableauVersion The application version number.

Tableau Prep Builder: Returns the exact version. For example 2020.4.1

Tableau Prep Conductor: Returns the major server version where Tableau Prep Conductor is enabled. For example 2020.4

FlowName The name of the .tfl file in Tableau Prep Builder Example: Entertainment Data_Cleaned