What's New in the JavaScript API

Changes in the JavaScript API for Tableau 2020.3

This section lists the changes that were made for the version of the JavaScript API that ships with Tableau 2020.3.
JavaScript API version: tableau-2.6.0.min.js.

  • To support the ability to export the crosstab data from a worksheet directly to Excel, the JavaScript API added the exportCrossTabToExcel method. This method performs the same function as the Worksheet > Export > Crosstab to Excel operation in Tableau. The method generates the .xlsx file and downloads it to your default location.
  • The applyRangeFilterAsync method now correctly supports NullOption enumeration. The method supports the equivalent functions of the Filter dialog box for dimensions or measures. You can include or exclude null values from a range, or set a special filter for all null or non-null values.
  • The GetFiltersAsyncOptions method, now correctly checks for the Only Relevant Values option when evaluating other filter settings that might be set, and returns only the values that pass those filters. The method now accurately returns all the filters used in a sheet.
  • When a Tableau view is embedded in a Salesforce page, the dropdown menus in the view now work as expected.
  • When you click column or row headers in an embedded Tableau view, selection events now fire correctly.

Changes in the JavaScript API for Tableau 2020.2

    This section lists the changes that were made for the version of the JavaScript API that ships with Tableau 2020.2.
    JavaScript API version: tableau-2.5.0.min.js.

  • To support the Tableau Data Model(Link opens in a new window) introduced in Tableau 2020.2, the Tableau JavaScript API provides new APIs and data structures that support the logical and physical tables in the data model. Use these new methods to get the underlying data from worksheets. The new methods replace getUnderlyingDataAsync. Starting in Tableau 2020.2, a data source can have multiple logical tables, and a logical table can contain one or more physical tables. If you have an existing embedding solution that use the deprecated getUnderlyingDataAsync() method to get underlying data, the method call could fail if the data source contains more than one logical table. You should update your embedding solution to use these new methods.

    Interface/Method Tableau 2020.2 and later
    Worksheet.getUnderlyingDataAsync Deprecated
    Worksheet.getUnderlyingTablesAsync New
    Worksheet.getUnderlyingTableDataAsync New
  • To support the data model, the JavaScript API also includes the LogicalTable class that has two properties: getCaption() and getTableId(). The getCaption returns the name of the table as it appears in Tableau. To get the underlying data from the table, you use the id returned by getTableId() when you call the getUnderlyingTableDataAsync() method.
    For more information about getting underlying data from worksheets, see the Get Underlying Table Data Example.

  • New method showExportPowerPointDialog() that displays the Export to Power Point dialog box, which shows a dialog allowing the user to choose the sheets from the workbook or dashboard to download in a PowerPoint file.

Changes in the JavaScript API for Tableau 2020.1

This section lists changes that were made for the version of the JavaScript API that ships with Tableau 2020.1.

  • Support for URL action events (URL_ACTION). You can now use the addEventListener() method to add an event listener for URL actions. For more information, see URL Action Example.

  • The selectMarksAsync() method now correctly initiates the URL action associated with the selection.

Changes in the JavaScript API for Tableau 2019.3

This section lists changes that were made for the version of the JavaScript API that ships with Tableau 2019.3.

  • There is a new property for categorical filters. The getIsAllSelected() property returns true if all values in the filter are selected.

  • The getAppliedValues() property now correctly returns the selected values if the number of selected values is under 5000. The getAppliedValues() property previously placed a 5000 value limit to the full domain of the filter, so if the filter domain had more than 5000 values, only the selected values from the first 200 values were returned. Now the return set is first filtered to the selected values before the limit of 5000 values is applied. Therefore, if the number of selected values is less than 5000, the complete set of selected values is returned. If the number of selected values is over 5000, only the first 200 selected values are returned. For more information, see CategoricalFilter Class.

Changes in the JavaScript API for Tableau Server 10.3

This section lists changes that were made for the version of the JavaScript API that ships with Tableau Server 10.3.

Toolbar Functions

You can now access toolbar buttons so that you can customize the controls for the visualization. In this release, you can call methods to control the Undo and Redo buttons and set up an event listener to monitor toolbar state changes. For more information, see Toolbar State Example.

Added to the JavaScript API for Tableau Server 10.0

This section lists changes that were made for the version of the JavaScript API that ships with Tableau Server 10.0.

Get Data for Visualizations

You can now get the data that was used to create the currently displayed visualization. Use the getSummaryDataAsync method and the getUnderlyingDataAsync method to get data for the currently active sheet. The getSummaryDataAsync method displays aggregated data for the fields used in the current view, that is, it displays data only for the measures and dimensions used to create the view. The getUnderlyingDataAsync method displays data for all fields in the data source that is used by the current view. For more information, see Get Data and the API Reference.

Added to the JavaScript API for Tableau Server 9.1

This section lists changes that were made for the version of the JavaScript API that ships with Tableau Server 9.1.

Easier way to load the latest version of the API

You can load the JavaScript API library using a file name that contains only the major version number, such as tableau_2.min.js. This in turn loads the most recent version of the library.

For details, see Accessing the API.


Thanks for your feedback! There was an error submitting your feedback. Please try again.