• Public
  • Public/Protected
  • All

Interface Extensions

The extension namespace contains all functionality available to Extensions in Tableau.


  • Extensions



Optional dashboardContent

dashboardContent: DashboardContent

The dashboardContent namespace provides access to the dashboard object. When you have the dashboard object, you have access to all elements in the dashboard including the worksheets, marks, filters, parameters, and data sources. To access the objects in this name space, specify tableau.extensions.dashboardContent.


dashboardObjectId: number

The dashboard object id for the extension that is running.




environment: Environment

The environment namespace provides methods to programmatically gather information about the environment in which the extension is running. To access the objects in this name space, specify tableau.extensions.environment.


settings: Settings

The settings namespace provides methods to get and set values which will be persisted in a workbook. You can use the settings to configure an extension. To access the objects in this name space, specify tableau.extensions.settings.


ui: UI

The ui namespace provides methods for an extension to display a popup dialog window. To access the objects in this name space, specify tableau.extensions.ui.


workbook: Workbook

The currently opened workbook.


1.6.0 and Tableau 2021.3



  • createVizImageAsync(inputSpec: object): Promise<string>
  • since

    1.8.0 and Tableau 2021.4

    For additional information on using the createVizImageAsync method, see Add Tableau Viz to Your Dashboard Extensions.

    For additional information about setting options in the inputSpec object, see Tableau Viz Reference.


    • inputSpec: object

      the object containing the embedded data and visual spec details


      The following is an example of an input spec object.

      var myInputSpec = {
            description: 'A simple bar chart with embedded data.',
            data: {
                values: [
                    { Category: 'A', Measure: 28, Weather: 10 },
                    { Category: 'B', Measure: 55, Weather: 9 },
                    { Category: 'C', Measure: 43, Weather: 8 },
            mark: tableau.MarkType.Bar,
            encoding: {
                columns: { field: 'Category', type: tableau.VizImageEncodingType.Discrete },
                rows: { field: 'Measure', type: tableau.VizImageEncodingType.Continuous },
                sort: { field: 'Category', 'sortby': 'Weather', direction: tableau.VizImageSortDirectionType.Ascending }

    Returns Promise<string>

    A promise that when resolved, returns the viz as an svg.

    Supports sorting by field.


  • initializeAsync(contextMenuCallbacks?: undefined | {}): Promise<void>
  • This is the entry point for an Extension. This function must first be called in order to interact with any of the other Extension APIs.


    • Optional contextMenuCallbacks: undefined | {}

      This optional object maps the ids of context menu items to the function to be triggered when that context menu item is selected. The keys listed must matched the keys registered in the context-menu element of the manifest. Currently, only a single context menu item is available ('configure') that creates the Configure... menu item), so this object will only contain a single entry. In this example, the 'configure' key is mapped to a function of the same name, which you would define in your JavaScript code.

        $(document).ready(function () {
          tableau.extensions.initializeAsync({'configure': configure}).then(function() {
          // When the user clicks the Configure... context menu item,
          // the configure function specified as the argument here
          // is executed.

    Returns Promise<void>

    A promise that when resolved, the other Extension APIs will be available to use.


  • initializeDialogAsync(): Promise<string>
  • The initializeDialogAsync function is the entry point for an extension that runs inside a dialog box (or popup window) created by the UI namespace. A call to tableau.extensions.ui.displayDialogAsync(payload) creates the dialog box. When the extension running in the dialog box loads, the extension must first call the initializeDialogAsync function to use the rest of the Extension API. The initializeDialogAsync function should only be called by extensions that are displayed in a dialog box. You use the initializeAsync function to initialize the main extension, that is, the parent of the extension in the dialog box.

    Returns Promise<string>

    A promise that when resolved the other Extension APIs will be available to use. Contains a string that is the initial payload for the dialog as sent by the parent extension via tableau.extensions.ui.displayDialogAsync(payload). See displayDialogAsync for more information.


  • setClickThroughAsync(clickThroughEnabled: boolean): Promise<void>
  • This method allows for clicks to pass through the extension window on Tableau Server.


    1.7.0 and Tableau 2021.4


    • clickThroughEnabled: boolean

      A boolean which represents if clicks should pass through the extension window

    Returns Promise<void>

    A promise that resolves when the click through property has been set.

    The following example shows a call made to setClickThroughAsync.

       // disabling pointer events on the extension window
       tableau.extensions.setClickThroughAsync(true).then(() => {
        console.log('Successfully enabled extension window click through');
       }).catch((error) => {
        // Can throw an error if called from a dialog or on Tableau Desktop