---
schema_version: "1"
id: 69e9ad02ea6b69206e262950a3619249d31e43bd859b8c047757a74acb69e0e4
title: VizActions | Tableau Embedding API
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/api/embedding_api/reference/interfaces/VizActions.md
canonical_url: https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/VizActions.html
source_site: help.tableau.com
content_type: documentation
content_hash: b7059c92c57ff9eba767e0ba2f7bfabb2185a9af08004d880a03b0ac69a897f2
description: Documentation for Tableau Embedding API
---
- VizActions

# Interface VizActions

Partially implemented - Actions related to events and state of the viz

interface VizActions {  
    [automaticUpdatesArePaused](#automaticupdatesarepaused): boolean;  
    [addEventListener](#addeventlistener-1)(  
        type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html),  
        listener: EventListenerOrEventListenerObject,  
        options?: boolean | AddEventListenerOptions,  
    ): void;  
    [addFilter](#addfilter-1)(fieldName: string, value: string): void;  
    [displayDialogAsync](#displaydialogasync-1)(dialogType: [TableauDialogType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauDialogType.html)): Promise<void\>;  
    [exportCrosstabAsync](#exportcrosstabasync-1)(  
        sheetName: string,  
        format: [CrosstabFileFormat](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/CrosstabFileFormat.html),  
    ): Promise<void\>;  
    [exportDataAsync](#exportdataasync-1)(  
        sheetName: string,  
        options?: [ExportDataOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportDataOptions.html),  
    ): Promise<void\>;  
    [exportImageAsync](#exportimageasync-1)(): Promise<void\>;  
    [exportPDFAsync](#exportpdfasync-1)(  
        sheetNames?: string\[\],  
        options?: [ExportPDFOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportPDFOptions.html),  
    ): Promise<void\>;  
    [exportPowerPointAsync](#exportpowerpointasync-1)(sheetNames?: string\[\]): Promise<void\>;  
    [getCurrentSrcAsync](#getcurrentsrcasync-1)(): Promise<string\>;  
    [getVizQLDataServiceSessionInfo](#getvizqldataservicesessioninfo-1)(): [VizQLDataServiceSessionInfo](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/VizQLDataServiceSessionInfo.html);  
    [isAnalyticsAssistantAvailableAsync](#isanalyticsassistantavailableasync-1)(): Promise<boolean\>;  
    [launchAnalyticsAssistantAsync](#launchanalyticsassistantasync-1)(): Promise<void\>;  
    [pauseAutomaticUpdatesAsync](#pauseautomaticupdatesasync-1)(): Promise<void\>;  
    [redoAsync](#redoasync-1)(): Promise<void\>;  
    [refreshDataAsync](#refreshdataasync-1)(): Promise<void\>;  
    [removeEventListener](#removeeventlistener-1)(  
        type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html),  
        listener: EventListenerOrEventListenerObject,  
        options?: boolean | EventListenerOptions,  
    ): void;  
    [resize](#resize-1)(): void;  
    [resumeAutomaticUpdatesAsync](#resumeautomaticupdatesasync-1)(): Promise<void\>;  
    [revertAllAsync](#revertallasync-1)(): Promise<void\>;  
    [toggleAutomaticUpdatesAsync](#toggleautomaticupdatesasync-1)(): Promise<void\>;  
    [undoAsync](#undoasync-1)(): Promise<void\>;  
}

#### Hierarchy ([View Summary](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/hierarchy.html#VizActions))

- VizActions
    - [Viz](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/Viz.html)

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:171

##### Index

### Methods

[addEventListener](#addeventlistener) [addFilter](#addfilter) [displayDialogAsync](#displaydialogasync) [exportCrosstabAsync](#exportcrosstabasync) [exportDataAsync](#exportdataasync) [exportImageAsync](#exportimageasync) [exportPDFAsync](#exportpdfasync) [exportPowerPointAsync](#exportpowerpointasync) [getCurrentSrcAsync](#getcurrentsrcasync) [getVizQLDataServiceSessionInfo](#getvizqldataservicesessioninfo) [isAnalyticsAssistantAvailableAsync](#isanalyticsassistantavailableasync) [launchAnalyticsAssistantAsync](#launchanalyticsassistantasync) [pauseAutomaticUpdatesAsync](#pauseautomaticupdatesasync) [redoAsync](#redoasync) [refreshDataAsync](#refreshdataasync) [removeEventListener](#removeeventlistener) [resize](#resize) [resumeAutomaticUpdatesAsync](#resumeautomaticupdatesasync) [revertAllAsync](#revertallasync) [toggleAutomaticUpdatesAsync](#toggleautomaticupdatesasync) [undoAsync](#undoasync)

### Properties

[automaticUpdatesArePaused](#automaticupdatesarepaused)

## Methods

### addEventListener[](#addeventlistener)

- addEventListener(  
        type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html),  
        listener: EventListenerOrEventListenerObject,  
        options?: boolean | AddEventListenerOptions,  
    ): void[](#addeventlistener-1)
    
    Adds an event listener to the specified event.
    
    ```
    async function getSelectedMarks(event) {    const marksSelected = await event.detail.getMarksAsync();    const numMarks = marksSelected.data[0].data.length;    console.log(`${numMarks} marks Selected`);}let viz = document.getElementById('tableauViz');viz.addEventListener("markselectionchanged", getSelectedMarks);
    ```
    
    #### Parameters
    
    - type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html)
    - listener: EventListenerOrEventListenerObject
    - `Optional`options: boolean | AddEventListenerOptions
    
    #### Returns void
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:356

### addFilter[](#addfilter)

- addFilter(fieldName: string, value: string): void[](#addfilter-1)
    
    Use this method to filter the viz before initialization. If used after initialization, it will re-render the viz. For filtering after initialization, use the other filtering methods, such as `applyFilterAsync`.
    
    If you add the same filter fields using the `addFilter()` method and by using the `<viz-filter>` element in the `<tableau-viz>` web component, you might experience unexpected behavior.
    
    #### Parameters
    
    - fieldName: string
        
        The name of the field to filter on.
    - value: string
        
        Single value or a list of comma separated values to filter on.
        
        ```
        viz.addFilter('Region', 'Central,West');
        ```
    
    #### Returns void
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:382

### displayDialogAsync[](#displaydialogasync)

- displayDialogAsync(dialogType: [TableauDialogType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauDialogType.html)): Promise<void\>[](#displaydialogasync-1)
    
    Display one of the export dialogs based on the dialogType parameter
    
    Throws an error if dialogType is invalid
    
    #### Parameters
    
    - dialogType: [TableauDialogType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauDialogType.html)
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:325

### exportCrosstabAsync[](#exportcrosstabasync)

- exportCrosstabAsync(  
        sheetName: string,  
        format: [CrosstabFileFormat](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/CrosstabFileFormat.html),  
    ): Promise<void\>[](#exportcrosstabasync-1)
    
    Exports the crosstab of any given worksheet within the current view to a specified format (CrosstabFileFormat.Excel, CrosstabFileFormat.CSV). Throws an error if the sheet name does not match any worksheets within the active sheet. Throws an error if the crosstab file failed to be created.
    
    Note
    
    `exportCrosstabAsync` resolves when a download is initiated. It does not indicate that a download was successful or if the download was complete.
    
    ```
    let viz = document.getElementById('tableauViz');viz.exportCrosstabAsync('Sales by Segment', CrosstabFileFormat.CSV);
    ```
    
    #### Parameters
    
    - sheetName: string
    - format: [CrosstabFileFormat](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/CrosstabFileFormat.html)
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:219

### exportDataAsync[](#exportdataasync)

- exportDataAsync(sheetName: string, options?: [ExportDataOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportDataOptions.html)): Promise<void\>[](#exportdataasync-1)
    
    Exports the summary data shown in the View Data window (shown when you click Download > Data from the toolbar for any given worksheet within the current view). The current file format is CSV. There is no limitation on the amount of summary data you can export. Throws an error if the sheet name does not match any worksheets within the active sheet. Throws an error if the CSV file failed to be created.
    
    Note
    
    `exportDataAsync` resolves when a download is initiated. It does not indicate that a download was successful or if the download was complete.
    
    ```
    let viz = document.getElementById('tableauViz');const activeSheet = viz.workbook.activeSheet;if (activeSheet.sheetType === SheetType.Worksheet) {  const columns = await activeSheet.getSummaryColumnsInfoAsync();  // Getting fieldId's for Latitude and Longitude columns  const columnsToIncludeById = columns.map((column) => {    if (column.fieldName === 'Latitude' || column.fieldName === 'Longitude') {      return column.fieldId;    }  });  await viz.exportDataAsync(activeSheet.name, { columnsToIncludeById });}else if (activeSheet.sheetType === SheetType.Dashboard) {  // Exporting the summary data for each worksheet in the dashboard while also ignoring aliases  for (const worksheet of activeSheet.worksheets) {    await viz.exportDataAsync(worksheet.name, { ignoreAliases: true });  }}else{  // activeSheet is a Story and we want to export worksheets within the current view  const containedSheet = activeSheet.activeStoryPoint.containedSheet;  if (containedSheet !== undefined && containedSheet.sheetType === SheetType.Worksheet) {    // Exporting summary data of a worksheet within the active story point    await viz.exportDataAsync(containedSheet.name);  } else if (containedSheet !== undefined && containedSheet.sheetType === SheetType.Dashboard) {    // Exporting the summary data for each worksheet within the active story point    for (const worksheet of containedSheet.worksheets) {      await viz.exportDataAsync(worksheet.name);    }  }}
    ```
    
    #### Parameters
    
    - sheetName: string
    - `Optional`options: [ExportDataOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportDataOptions.html)
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:264

### exportImageAsync[](#exportimageasync)

- exportImageAsync(): Promise<void\>[](#exportimageasync-1)
    
    Equivalent to clicking on Download > Image from the toolbar, which creates a PNG file of the current visualization.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:205

### exportPDFAsync[](#exportpdfasync)

- exportPDFAsync(sheetNames?: string\[\], options?: [ExportPDFOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportPDFOptions.html)): Promise<void\>[](#exportpdfasync-1)
    
    Exports the list of sheets with the given [ExportPDFOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportPDFOptions.html) options. If no sheets are specified, the current sheet is exported. The list of sheets can either exclusively include the worksheets within a dashboard or exclusively include the published sheets from the workbook. If no ExportPDFOptions are specified, the default settings are: Scaling = Automatic, PageSize = Letter, and Orientation = Portrait.
    
    Throws an error if the list of sheets contains both worksheets within a dashboard and published sheets from the workbook. Throws an error if the PDF file fails to be created.
    
    Note
    
    `exportPDFAsync` resolves when a download is initiated. It does not indicate that a download was successful or if the download was complete.
    
    ```
    let viz = document.getElementById('tableauViz');const workbook = viz.workbook;const activeSheet = workbook.activeSheet;if (activeSheet.sheetType === SheetType.Worksheet || activeSheet.sheetType === SheetType.Story) {  await viz.exportPDFAsync();} else if (activeSheet.sheetType ===  SheetType.Dashboard) {  const worksheetNames = activeSheet.worksheets.map((worksheet) => worksheet.name);  await viz.exportPDFAsync(worksheetNames);}// exporting all sheets within the workbook to PDFconst publishedSheetNames = workbook.publishedSheetsInfo.map((publishedSheetInfo) => publishedSheetInfo.name);await viz.exportPDFAsync(publishedSheetNames);
    ```
    
    #### Parameters
    
    - `Optional`sheetNames: string\[\]
    - `Optional`options: [ExportPDFOptions](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/ExportPDFOptions.html)
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:318

### exportPowerPointAsync[](#exportpowerpointasync)

- exportPowerPointAsync(sheetNames?: string\[\]): Promise<void\>[](#exportpowerpointasync-1)
    
    Exports the list of sheets to a PowerPoint file. If no sheets are specified, the current sheet is exported. The order the sheets appear in the list is the order the sheets appear in the PowerPoint file. The list of sheets can either exclusively include the worksheets within a dashboard or exclusively include the published sheets from the workbook.
    
    Throws an error if the list of sheets contains both worksheets within a dashboard and published sheets from the workbook. Throws an error if the PowerPoint file fails to be created.
    
    Note
    
    `exportPowerPointAsync` resolves when a download is initiated. It does not indicate that a download was successful or if the download was complete.
    
    ```
    let viz = document.getElementById('tableauViz');const workbook = viz.workbook;const activeSheet = workbook.activeSheet;if (activeSheet.sheetType === SheetType.Worksheet || activeSheet.sheetType === SheetType.Story) {  await viz.exportPowerPointAsync();} else if (activeSheet.sheetType ===  SheetType.Dashboard) {  const worksheetNames = activeSheet.worksheets.map((worksheet) => worksheet.name);  await viz.exportPowerPointAsync(worksheetNames);}// exporting all sheets within the workbook to PowerPointconst publishedSheetNames = workbook.publishedSheetsInfo.map((publishedSheetInfo) => publishedSheetInfo.name);await viz.exportPowerPointAsync(publishedSheetNames);
    ```
    
    #### Parameters
    
    - `Optional`sheetNames: string\[\]
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:291

### getCurrentSrcAsync[](#getcurrentsrcasync)

- getCurrentSrcAsync(): Promise<string\>[](#getcurrentsrcasync-1)
    
    Gets the visualization's current URL.
    
    #### Returns Promise<string\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:330

### getVizQLDataServiceSessionInfo[](#getvizqldataservicesessioninfo)

- getVizQLDataServiceSessionInfo(): [VizQLDataServiceSessionInfo](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/VizQLDataServiceSessionInfo.html)[](#getvizqldataservicesessioninfo-1)
    
    Gets the server session information for use with VizQL Data Service. The server session information contains the VizQL Server Session ID (X-Session-Id) and the Global Session Header (Global-Session-Header).
    
    #### Returns [VizQLDataServiceSessionInfo](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/VizQLDataServiceSessionInfo.html)
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:418

### isAnalyticsAssistantAvailableAsync[](#isanalyticsassistantavailableasync)

- isAnalyticsAssistantAvailableAsync(): Promise<boolean\>[](#isanalyticsassistantavailableasync-1)
    
    Indicates whether the Analytics Assistant side pane is available.
    
    #### Returns Promise<boolean\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:412

### launchAnalyticsAssistantAsync[](#launchanalyticsassistantasync)

- launchAnalyticsAssistantAsync(): Promise<void\>[](#launchanalyticsassistantasync-1)
    
    Use this method to launch the Analytics Assistant side pane. You can use the `isAnalyticsAssistantAvailableAsync()` method to check if the Analytics Assistant is available for use.
    
    ```
    const isAnalyticsAssistantAvailable = await viz.isAnalyticsAssistantAvailableAsync();if (isAnalyticsAssistantAvailable) {  await viz.launchAnalyticsAssistantAsync();}
    ```
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:407

### pauseAutomaticUpdatesAsync[](#pauseautomaticupdatesasync)

- pauseAutomaticUpdatesAsync(): Promise<void\>[](#pauseautomaticupdatesasync-1)
    
    Pause layout updates. This is useful if you are resizing the visualization or performing multiple calls that could affect the layout.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:180

### redoAsync[](#redoasync)

- redoAsync(): Promise<void\>[](#redoasync-1)
    
    Redoes the last action performed on a sheet.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:335

### refreshDataAsync[](#refreshdataasync)

- refreshDataAsync(): Promise<void\>[](#refreshdataasync-1)
    
    Equivalent to clicking on the Refresh Data toolbar button.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:200

### removeEventListener[](#removeeventlistener)

- removeEventListener(  
        type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html),  
        listener: EventListenerOrEventListenerObject,  
        options?: boolean | EventListenerOptions,  
    ): void[](#removeeventlistener-1)
    
    Removes an event listener from the specified event.
    
    ```
    let viz = document.getElementById('tableauViz');viz.removeEventListener("markselectionchanged", getSelectedMarks);
    ```
    
    #### Parameters
    
    - type: [TableauEventType](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/enums/TableauEventType.html)
    - listener: EventListenerOrEventListenerObject
    - `Optional`options: boolean | EventListenerOptions
    
    #### Returns void
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:366

### resize[](#resize)

- resize(): void[](#resize-1)
    
    Use this method to readjust the dimensions of the embedded viz in response to things like a window resize, device orientation change, or parent container resize.
    
    ```
    window.addEventListener('resize', () => viz.resize());new ResizeObserver(() => viz.resize()).observe(viz.parentElement);
    ```
    
    #### Returns void
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:394

### resumeAutomaticUpdatesAsync[](#resumeautomaticupdatesasync)

- resumeAutomaticUpdatesAsync(): Promise<void\>[](#resumeautomaticupdatesasync-1)
    
    Resume layout updates.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:185

### revertAllAsync[](#revertallasync)

- revertAllAsync(): Promise<void\>[](#revertallasync-1)
    
    Equivalent to clicking on the Revert All toolbar button, which restores the workbook to its starting state.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:195

### toggleAutomaticUpdatesAsync[](#toggleautomaticupdatesasync)

- toggleAutomaticUpdatesAsync(): Promise<void\>[](#toggleautomaticupdatesasync-1)
    
    Toggle layout updates.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:190

### undoAsync[](#undoasync)

- undoAsync(): Promise<void\>[](#undoasync-1)
    
    Undoes the last action performed on a sheet.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:340

## Properties

### `Readonly`automaticUpdatesArePaused[](#automaticupdatesarepaused)

automaticUpdatesArePaused: boolean

Indicates whether automatic updates are currently paused.

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/VizInterfaces.ts:175

### Settings

Member Visibility

- Protected
- Inherited
- External

ThemeOSLightDark

### On This Page

Methods

[addEventListener](#addeventlistener)[addFilter](#addfilter)[displayDialogAsync](#displaydialogasync)[exportCrosstabAsync](#exportcrosstabasync)[exportDataAsync](#exportdataasync)[exportImageAsync](#exportimageasync)[exportPDFAsync](#exportpdfasync)[exportPowerPointAsync](#exportpowerpointasync)[getCurrentSrcAsync](#getcurrentsrcasync)[getVizQLDataServiceSessionInfo](#getvizqldataservicesessioninfo)[isAnalyticsAssistantAvailableAsync](#isanalyticsassistantavailableasync)[launchAnalyticsAssistantAsync](#launchanalyticsassistantasync)[pauseAutomaticUpdatesAsync](#pauseautomaticupdatesasync)[redoAsync](#redoasync)[refreshDataAsync](#refreshdataasync)[removeEventListener](#removeeventlistener)[resize](#resize)[resumeAutomaticUpdatesAsync](#resumeautomaticupdatesasync)[revertAllAsync](#revertallasync)[toggleAutomaticUpdatesAsync](#toggleautomaticupdatesasync)[undoAsync](#undoasync)

Properties

[automaticUpdatesArePaused](#automaticupdatesarepaused)