---
schema_version: "1"
id: e32bd7226b04c0b5afa5ba487675492e475753351277362544749637c64998c6
title: Workbook | Tableau Embedding API
collection: tableau
version: current
locale: en-us
portal_url: https://docs.salesforce.com/tableau/current/en-us/api/embedding_api/reference/interfaces/Workbook.md
canonical_url: https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Workbook.html
source_site: help.tableau.com
content_type: documentation
content_hash: 2eb97a06654eae26cda22ee7b4bc103f8156331b4c053da7680aed8afb9d60eb
description: Documentation for Tableau Embedding API
---
- Workbook

# Interface Workbook

interface Workbook {  
    [activeCustomView](#activecustomview): undefined | [CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html);  
    [activeSheet](#activesheet): [Sheet](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Sheet.html);  
    [name](#name): string;  
    [publishedSheetsInfo](#publishedsheetsinfo): [SheetInfo](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/SheetInfo.html)\[\];  
    [activateSheetAsync](#activatesheetasync-1)(sheetNameOrIndex: string | number): Promise<[Sheet](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Sheet.html)\>;  
    [changeParameterValueAsync](#changeparametervalueasync-1)(  
        name: string,  
        value: string | number | boolean | Date,  
    ): Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\>;  
    [getCustomViewsAsync](#getcustomviewsasync-1)(): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\[\]\>;  
    [getParametersAsync](#getparametersasync-1)(): Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\[\]\>;  
    [removeCustomViewAsync](#removecustomviewasync-1)(customViewName: string): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>;  
    [revertAllAsync](#revertallasync-1)(): Promise<void\>;  
    [saveCustomViewAsync](#savecustomviewasync-1)(customViewName: string): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>;  
    [setActiveCustomViewAsDefaultAsync](#setactivecustomviewasdefaultasync-1)(): Promise<void\>;  
    [showCustomViewAsync](#showcustomviewasync-1)(  
        customViewName?: null | string,  
    ): Promise<undefined | [CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>;  
}

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:4

##### Index

### Methods

[activateSheetAsync](#activatesheetasync) [changeParameterValueAsync](#changeparametervalueasync) [getCustomViewsAsync](#getcustomviewsasync) [getParametersAsync](#getparametersasync) [removeCustomViewAsync](#removecustomviewasync) [revertAllAsync](#revertallasync) [saveCustomViewAsync](#savecustomviewasync) [setActiveCustomViewAsDefaultAsync](#setactivecustomviewasdefaultasync) [showCustomViewAsync](#showcustomviewasync)

### Properties

[activeCustomView](#activecustomview) [activeSheet](#activesheet) [name](#name) [publishedSheetsInfo](#publishedsheetsinfo)

## Methods

### activateSheetAsync[](#activatesheetasync)

- activateSheetAsync(sheetNameOrIndex: string | number): Promise<[Sheet](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Sheet.html)\>[](#activatesheetasync-1)
    
    Activates the sheet, either by name or index, and returns a promise of the sheet that was activated.
    
    #### Parameters
    
    - sheetNameOrIndex: string | number
    
    #### Returns Promise<[Sheet](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Sheet.html)\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:28

### changeParameterValueAsync[](#changeparametervalueasync)

- changeParameterValueAsync(  
        name: string,  
        value: string | number | boolean | Date,  
    ): Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\>[](#changeparametervalueasync-1)
    
    Modifies the given parameter and assigns it a new value. The new value must fall within the domain restrictions defined by `allowableValues`. If the domain restriction is `ParameterValueType.Range`, be sure to check the `allowableValues` before assigning a new value. If the new value is out of range, the updated value will be set to either the `minValue` or the `maxValue` of the allowable range. If a step size is also specified and the new value does not fall on the step intervals, the updated value will be set to the closest, lower step, or closest, earlier date. If the domain restriction is type `ParameterValueType.List`, and there are aliases defined for the list, the aliased value should be passed to the method.
    
    #### Parameters
    
    - name: string
        
        The name of the parameter
    - value: string | number | boolean | Date
        
        The new value to assign to this parameter.
        
        Note
        
        For changing `Date` parameters, UTC Date objects are expected.
    
    #### Returns Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\>
    
    The updated `Parameter`. The promise is rejected if `name` or `value` is invalid. However, if the domain restriction is type `AllowableValuesType.Range`, and the `value` is out of the range bounds, the parameter gets set to the `minValue` or the `maxValue` of the range (whichever is closer). If the range has a `stepSize` or `dateStepPeriod`, the parameter gets set to the closest, lower step, or the closest, earlier date.
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:86

### getCustomViewsAsync[](#getcustomviewsasync)

- getCustomViewsAsync(): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\[\]\>[](#getcustomviewsasync-1)
    
    Gets the collection of CustomView objects associated with the workbook.
    
    #### Returns Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\[\]\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:38

### getParametersAsync[](#getparametersasync)

- getParametersAsync(): Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\[\]\>[](#getparametersasync-1)
    
    #### Returns Promise<[Parameter](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Parameter.html)\[\]\>
    
    A collection of all the Tableau parameters that are used in this workbook.
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:66

### removeCustomViewAsync[](#removecustomviewasync)

- removeCustomViewAsync(customViewName: string): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>[](#removecustomviewasync-1)
    
    Removes the named custom view.
    
    #### Parameters
    
    - customViewName: string
    
    #### Returns Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:51

### revertAllAsync[](#revertallasync)

- revertAllAsync(): Promise<void\>[](#revertallasync-1)
    
    Reverts the workbook to its last saved state.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:33

### saveCustomViewAsync[](#savecustomviewasync)

- saveCustomViewAsync(customViewName: string): Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>[](#savecustomviewasync-1)
    
    Saves the current state of the workbook by assigning a custom view name.
    
    #### Parameters
    
    - customViewName: string
    
    #### Returns Promise<[CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:56

### setActiveCustomViewAsDefaultAsync[](#setactivecustomviewasdefaultasync)

- setActiveCustomViewAsDefaultAsync(): Promise<void\>[](#setactivecustomviewasdefaultasync-1)
    
    Sets the active custom view as the default. If there is no active custom view, the default view is the original view.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:61

### showCustomViewAsync[](#showcustomviewasync)

- showCustomViewAsync(  
        customViewName?: null | string,  
    ): Promise<undefined | [CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>[](#showcustomviewasync-1)
    
    Changes the visualization to show the named saved state. `workbook.showCustomViewAsync("Awesome" ).then(function() { // do something });` To reset a custom view to the original view, do not provide the customViewName parameter. `workbook.showCustomViewAsync().then(function() { // do something });`
    
    #### Parameters
    
    - `Optional`customViewName: null | string
    
    #### Returns Promise<undefined | [CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:46

## Properties

### `Readonly`activeCustomView[](#activecustomview)

activeCustomView: undefined | [CustomView](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/CustomView.html)

Gets the currently active custom view, or undefined if no custom view is active.

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:23

### `Readonly`activeSheet[](#activesheet)

activeSheet: [Sheet](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/Sheet.html)

Gets the currently active sheet (the active tab).

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:13

### `Readonly`name[](#name)

name: string

Gets the name of the workbook saved to the server. Note that this is not necessarily the file name.

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:8

### `Readonly`publishedSheetsInfo[](#publishedsheetsinfo)

publishedSheetsInfo: [SheetInfo](https://help.tableau.com/current/api/embedding_api/en-us/reference/interfaces/SheetInfo.html)\[\]

Note that this is synchronous, meaning that all of the sheets are expected when loaded.

- Defined in packages/api-external-contract-js/src/ExternalContract/Embedding/WorkbookInterface.ts:18

### Settings

Member Visibility

- Protected
- Inherited
- External

ThemeOSLightDark

### On This Page

Methods

[activateSheetAsync](#activatesheetasync)[changeParameterValueAsync](#changeparametervalueasync)[getCustomViewsAsync](#getcustomviewsasync)[getParametersAsync](#getparametersasync)[removeCustomViewAsync](#removecustomviewasync)[revertAllAsync](#revertallasync)[saveCustomViewAsync](#savecustomviewasync)[setActiveCustomViewAsDefaultAsync](#setactivecustomviewasdefaultasync)[showCustomViewAsync](#showcustomviewasync)

Properties

[activeCustomView](#activecustomview)[activeSheet](#activesheet)[name](#name)[publishedSheetsInfo](#publishedsheetsinfo)