Was this page helpful?
Yes No

Save and Share Your Work

At any point in the flow, you can save your flow, view a preview of the data in your flow in Tableau Desktop, or create an extract of your data that includes all the operations that you’ve applied to your flow. You can also package your data with your flow to share it with others or publish your data extract to Tableau Server or Tableau Online as a data source.

In this article

Save a flow

Save your flow to back up your work before performing any additional operations. Your flow is saved in the Tableau Prep flow (.tfl) file format.

You can also package your local files (Excel, Text Files, and Tableau extracts) with your flow to share with others, just like packaging a workbook for sharing in Tableau Desktop. Only local files can be packaged with a flow. Data from database connections, for example, aren't included.

When you save a packaged flow, the flow is saved as a Packaged Tableau Flow File (.tflx).

  • To save your flow, from the top menu, select File > Save.

  • To package your data files with your flow, from the top menu, do one of the following:

    • Select File > Export Packaged Flow

    • Select File > Save As. Then in the Save As dialog, select Packaged Tableau Flow Files from the Save as type drop down menu.

(Back to top)


View your data sample in Tableau

Sometimes when you’re cleaning your data you might want to check your progress by looking at it in Tableau Desktop. When your flow opens in Tableau Desktop, Tableau Prep creates a permanent Tableau extract (.tde or .hyper depending on your version of Tableau) and a Tableau data source (.tds) file. The files are saved in your Tableau repository in the Datasources file so you can experiment with your data at any time.

When you open the flow in Tableau Desktop, you can see the data sample that you are working with in your flow with the operations applied to it, up to the step that you selected.

To view your data sample in Tableau do the following:

  1. Right-click the step where you want to view your data, and select Preview in Tableau Desktop from the context menu.

  2. Tableau Desktop opens on the Sheet tab.

(Back to top)


Create and publish data extracts and data sources

To create an extract, run your flow. When you run your flow your changes are applied to your entire data set. Running the flow results in a Tableau Data Source (.tds) and a Tableau Data Extract (.tde or .hyper) file. You can create an extract file from your flow output to use in Tableau Desktop or to share your data with third parties.

Note: You can publish data extracts or data sources to Tableau Server version 10.0 and later as well as to Tableau Online.

Setting up schedules in Tableau Server or Tableau Online to automatically refresh your data outputs is not yet supported but you can refresh your output files from the command line. For more information, see Refresh output files from the command line.

You can create an extract file in the following formats:

  • Tableau Data Extract (.tde): The extract is saved as both a Tableau extract (.tde) and a Tableau data source (.tds) file. Use this file type if you use Tableau Desktop or Tableau Server version 10.0 through 10.4.

  • Hyper Extract (.hyper): This is the new Tableau extract file type but can only be consumed by Tableau Desktop or Tableau Server version 10.5 and later.

  • Comma Separated Value (.csv): Save the extract to a .csv file to share your data with third parties. The encoding of exported CSV file will be UTF-8 with BOM.

You can also publish your output as a data source to Tableau Server or Tableau Online to share your data and provide centralized access to the data you have cleaned, shaped, and combined.

Note: To publish your output to Tableau Server, the Tableau Server REST API must be enabled. For more information see Rest API Requirements in the Tableau Rest API Help. To publish to a server that uses Secure Socket Layer (SSL) encryption certificates, additional configuration steps are needed on the machine running Tableau Prep. For more information, see the System Requirements in the Tableau Desktop and Tableau Prep Deployment Guide.

Create an extract file

  1. Click the plus icon on a step and select Add Output.

    If you have run the flow before, click the run flow button on the Output step. This overwrites the previous output.

    The Output pane opens and shows you a snapshot of your data.

  2. In the left pane select Save to file.

  3. Click the Browse button, then in the Save Extract As dialog, enter a name for the file and click Accept.

  4. In the Output type field, select the output type. Depending on the version of Tableau Desktop you use you can choose from the following options:

    • Tableau Data Extract (.hyper) for Tableau Desktop version 10.5 and later.

    • Tableau Data Extract (.tde) for Tableau Desktop version 10.0 through 10.4.

    • Comma Separated Values (.csv) if you want to share the extract with a third party.

    Tip: You have choices when generating output from your flow. You can generate an extract file, or you can publish your data as a data source to Tableau Server or Tableau Online. For more information about generating output files, see Create and publish data extracts and data sources.

  5. Click Run Flow to run the flow and generate the extract file.

Publish as a data source

  1. Click the plus icon on a step and select Add Output.

    If you have run the flow before, click the run flow button on the Output step. This overwrites the previous output.

  2. The output pane opens and shows you a snapshot of your data.

  3. Select the Publish as data source radio button and complete the following fields:

    • Server: Select the Tableau server where you want to publish the data source and data extract. If you aren't signed in to a server you will be prompted to sign in.

      On the Mac you may be prompted to provide access to your Mac keychain so Tableau Prep can securely use SSL certificates to connect to your Tableau Server or Tableau Online environment.

    • Project: Select the project where you want to load the data source and extract.

    • Name: Enter file name

    • Description: Enter a description for the data source.

  4. Click Run Flow to run the flow and publish the data source.

(Back to top)


Refresh output files from the command line

If you want to refresh output files for your flow you can run the flow from the command line instead of opening it in Tableau Prep and running the flow from there.

This option is available on both Windows and Mac machines where Tableau Prep is installed.

For Windows machines, you can also schedule this process using Windows Task Scheduler. For more information about using Windows Task Scheduler, see Task Scheduler in the Microsoft online help.

When you run flows from the command line, Tableau Prep refreshes all outputs for the flow.

Note: The output location for the files is specified in the output step for the flow in Tableau Prep when you run the flow. When you refresh the files from the command line, this process uses that same location and will overwrite any previous output files for the flow with the refreshed version.

For information about how to specify an output location for your flow files, see Create and publish data extracts and data sources.

To run the flow from the command line, you'll need the following:

  • Administrator privileges on the machine where you are running the flow.

  • The path where Tableau Prep is installed.

  • If connecting to databases and publishing output files to a server, a credentials .json file that includes all required credentials.

  • The path where the Tableau Flow (.tfl) file is located.

Before running the flow

If you are running a flow that connects to database files or publishes output files to a server, then you'll need to create a .json file that includes the credentials that are required to connect to these locations.

When you run the process, the hostname, port and username provided in the credentials .json file is used to find the matching connection in the Tableau flow file (tfl) and updated before running the process.

Note: Skip this step if the flow connects to and outputs to local files, files stored on a network share or input files that use Windows Authentication (SSPI). For more information about Windows Authentication, see SSPI Model in the Microsoft online help.

If you plan to reuse the file, place it in a folder where it won't be overwritten by the Tableau Prep install process.

The following table lists the credentials that you need to include in the .json file. Port ID and Site ID are optional if your connections don't require this information.

Input connections Output location
  • User name
  • Host name (Server name)
  • Port ID
  • Password
  • Server Url
  • Content Url (Site ID. This appears after /site/ in the URL when you sign into Tableau Server or Tableau Online)
  • User name
  • Password

The following example shows the syntax to use for the credentials .json file.

In this example the flow connects to two databases (Microsoft SQL Server and Oracle) and outputs files to a server that includes a Site ID.

{
"inputConnections":[
  {
    "username": "jsmith",
    "hostname":"mssql.example.lan",
    "port":1234,
    "password": "passw0rd"
  },
  {
    "username": "jsmith",
    "hostname":"Oracle.example.lan",
    "port":5678,
    "password": "passw0rd" 
  }
],
"outputConnections":[
  {
    "serverUrl":"http://MyServer",
    "contentUrl":"FinanceTeam",
    "username":"jsmith",
    "password":"passw0rd$"
  }
]
}

Tips for creating your credentials file

Tableau Prep uses information from the flow file and from the credentials .json file to run the flow when you have remote connections. For example, the database name for your remote connections and the project name for your output files come from the flow, and the server name and the log in credentials come from the .json file.

To avoid errors when running the flow, make sure your credentials file follows these guidelines:

  • If using Tableau Prep version 2018.2.2 through 2018.3.1, always include the "inputConnections" and "outputConnections" arrays even if the flow doesn't have remote connections for inputs or outputs. Just leave those arrays blank. If you are using Tableau Prep version 2018.3.2 and later you don't need to include the blank array.

    • No remote input connection? Include this syntax at the top of the .json file

      {
      "inputConnections":[
        ],
    • No remote output connection? Include this syntax at the bottom of the .json file

    • "outputConnections":[
        ]
      }
  • No port ID for your input connection? Don't include the "port":xxxx, reference in the .json file, not even "port": "".

  • When referencing the "serverUrl": don't include a "/" at the end of the address. For example, use this "serverUrl": "http://server" not this "serverUrl": "http://server/".

  • If you have multiple input or output connections include the credentials for each one in the file.

Run the flow

  1. Open the command prompt or terminal command prompt (Mac) as an Administrator.

  2. Run one of the following commands:

    • The flow connects to local files or files stored on a network share and publishes to local files, files stored on a network share or uses Windows authentication:

      Note: If connecting to or outputting to files stored on a network share, use the UNC format for the path: \\server\path\file name. It can't be password protected.

      Windows

       "\[Tableau Prep install location]\Tableau Prep <version>\scripts"\tableau-prep-cli.bat -t "path\to\[your flow file name].tfl"

      Mac

      /Applications/Tableau\ Prep\[Tableau Prep version].app/Contents/scripts/./tableau-prep-cli -t path/to/[your flow file name].tfl
    • The flow connects to databases or publishes to a server:

      Windows

      "\[Tableau Prep install location]\Tableau Prep <version>\scripts"\tableau-prep-cli.bat -c "path\to\[your credential file name].json" -t "path\to\[your flow file name].tfl"

      Mac

      /Applications/Tableau\ Prep\[Tableau Prep version].app/Contents/scripts/./tableau-prep-cli -c path/to/[your credential file name].json -t path/to/[your flow file name].tfl
    • The flow file or credentials file is stored on a network share (use the UNC format for the path: \\server\path\file name):

      Windows

      "\[Tableau Prep install location]\Tableau Prep <version>\scripts"\tableau-prep-cli.bat -c "\server\path\[your credential file name].json" -t "\server\path\[your flow file name].tfl"

      Mac: Map the network share to /Volumes in Finder so that it is persistent, then use /Volumes/.../[your file] to specify the path:

      /Applications/Tableau\ Prep\ [Tableau Prep version].app/Contents/scripts/./tableau-prep-cli -c /Volumes/.../[your credential file name].json -t path/to/[your flow file name].tfl

    For examples of sample commands see Syntax examples. For common errors and resolutions see Common errors when using the command line to run flows.

Command options

If you want to view the help options, include -h in the command line.

Command options Description Notes
-c The connection path to the credentials file. Requires the path to where the credentials file is located.
-d Debug the flow process. Include this option to view more information to help debug a problem with refreshing the flow. Log files are stored in: My Tableau Prep Repository\Command Line Repository\Logs
-h View the help for syntax options

The help option or a syntax error shows the following information:

usage: tableau-prep-cli [-c <arg>] [-d] [-h] [-t <arg>]
-c,--connections <arg>   path to a file with all connection information
-d,--debug               This option is for debugging
-h,--help                print usage message
-t,--tflFile <arg>       The tableau prep flow file	
-t The .tfl flow file Requires the path to where the .tfl flow file is located.

Syntax examples

The command lines below show three different examples for running a flow using the following criteria:

  • Tableau Prep version: 2018.3.2

  • Flow name: Flow1.tfl

  • Flow location: C:\Users\jsmith\Documents\My Tableau Prep Repository\Flows

  • Credentials file name: Flow 1.json

  • Credentials file location: C:\Users\jsmith\Desktop\Flow credentials

  • Credentials file location stored on a network share: \tsi.lan\files\Flow credentials

The flow connects to and publishes to local files

Windows

"\Program Files\Tableau\Tableau Prep 2018.3.2\scripts"\tableau-prep-cli.bat   -t "\C:\Users\jsmith\Documents\My Tableau Prep Repository\Flows\Flow1.tfl"

Mac

/Applications/Tableau\ Prep\ 2018.3.2.app/Contents/scripts/./tableau-prep-cli  -t /Users/jsmith/Documents/My\ Tableau\ Prep\ Repository/Flows.Flow1.tfl

The flow connects to databases and publishes to a server

Windows

"\Program Files\Tableau\Tableau Prep 2018.3.2\scripts"\tableau-prep-cli.bat -c "\C:\Users\jsmith\Desktop\Flow credentials\Flow1.json" -t "\C:\Users\jsmith\Documents\My Tableau Prep Repository\Flows\Flow1.tfl"

Mac

/Applications/Tableau\ Prep\ 2018.3.2.app/Contents/scripts/./tableau-prep-cli -c /Users/jsmith/Desktop/Flow\ credentials/Flow1.json -t /Users/jsmith/Documents/My\ Tableau Prep\ Repository/Flows.Flow1.tfl

The flow publishes to a server and the credentials file is stored on a network share

Windows

"\Program Files\Tableau\Tableau Prep 2018.3.2\scripts"\tableau-prep-cli.bat -c "\\tsi.lan\files\Flow credentials\Flow1.json" -t "\C:\Users\jsmith\Documents\My Tableau Prep Repository\Flows\Flow1.tfl"
Mac/Applications/Tableau\ Prep\ 2018.3.2.app/Contents/scripts/./tableau-prep-cli -c /Volumes/files/Flow\ credentials/Flow1.json -t /Users/jsmith/Documents/My\ Tableau\ Prep Repository/Flows.Flow1.tfl

(Back to top)