---
schema_version: "1"
id: e8729422964024525254e2d5cb9a1570caee5d71c7d8277ed4c9083931e4b711
title: DataTableReader | 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/DataTableReader.md
canonical_url: https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTableReader.html
source_site: help.tableau.com
content_type: documentation
content_hash: 7fa8dc688c09d75265614060eb06c4d6e1cbe9f690d7c8d27e0bc8007489cf8d
description: Documentation for Tableau Embedding API
---
- DataTableReader

# Interface DataTableReader

A DataTableReader allows iteration over summary or underlying data by pages. The page size is established when the DataTableReader is created. (See getLogicalTableDataReaderAsync, getSummaryDataReaderAsync, or getUnderlyingTableDataReaderAsync.) The normal sequence of operations would be to

1. Create the DataTableReader for the desired DataTable.
2. Use DataTableReader.totalRowCount or DataTableReader.pageCount to discover how many rows or pages are in the desired DataTable.
3. Call DataTableReader.getPageAsync() to get the page(s) desired. Each page is a DataTable for that page. Alternatively, based on the DataTableReader.totalRowCount, DataTableReader.getAllPagesAsync can be used to fetch the entire DataTable.
4. Call DataTableReader.releaseAsync() to free up resources.

Notes for usage of a DataTableReader:

1. Since DataTableReaders consume server resources, an inactive DataTableReader will be automatically released after 60 minutes of inactivity. (A new DataTableReader can be created at that time, if needed.)
2. Calling getPageAsync() after an explicit or automatic releaseAsync() will throw an exception.
3. Only one active DataTableReader per logical table id is supported.
4. There are still limits on the number of rows supported for underlying and logical data table readers. The default limit is approximately 1 million rows of data for getUnderlyingTableDataReaderAsync, and approximately 32 million cells (rows \* columns) for getLogicalTableDataReaderAsync. Administrators may change these limits to better match computing resources with the Tableau Server (Cloud) or Tableau Desktop options: ExtensionsAndEmbeddingReaderRowLimit for getUnderlyingTableDataReaderAsync or ExtensionsAndEmbeddingReaderCellLimit for getLogicalTableDataReaderAsync.

interface DataTableReader {  
    [pageCount](#pagecount): number;  
    [totalRowCount](#totalrowcount): number;  
    [getAllPagesAsync](#getallpagesasync-1)(maxRows?: number): Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>;  
    [getPageAsync](#getpageasync-1)(pageNumber: number): Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>;  
    [releaseAsync](#releaseasync-1)(): Promise<void\>;  
}

- Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:215

##### Index

### Methods

[getAllPagesAsync](#getallpagesasync) [getPageAsync](#getpageasync) [releaseAsync](#releaseasync)

### Properties

[pageCount](#pagecount) [totalRowCount](#totalrowcount)

## Methods

### getAllPagesAsync[](#getallpagesasync)

- getAllPagesAsync(maxRows?: number): Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>[](#getallpagesasync-1)
    
    Get all the pages of data into a single DataTable. Calls to getAllPagesAsync() after releaseAsync() will throw an exception. To protect against possible browser failure, getAllPagesAsync will cap the data at a maximum of 400 pages. With a default pageRowCount of 10,000 this will give you a maximum of 4,000,000 rows of data.
    
    If sizes are larger than this, please process your data in page size chunks.
    
    #### Parameters
    
    - `Optional`maxRows: number
        
        Limits the request to maxRows. If maxRows === 0, requests all rows.
    
    #### Returns Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>
    
    A DataTable containing all the data available to the DataTableReader with the maximum page count above.
    
    ```
    // To simplify the example, we assume we have less than 4m rows of data// Since we are fetching all of the data, use the default page size in getSummaryDataReaderAsyncconst dataTableReader = await worksheet.getSummaryDataReaderAsync();const dataTable = await dataTableReader.getAllPagesAsync();await dataTableReader.releaseAsync();// ... process the data table ...
    ```
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:266

### getPageAsync[](#getpageasync)

- getPageAsync(pageNumber: number): Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>[](#getpageasync-1)
    
    Get a page of data. The page is returned as a DataTable. Calls to getPageAsync() after releaseAsync() will throw an exception.
    
    #### Parameters
    
    - pageNumber: number
        
        The page number (zero-indexed) to fetch. The page number should be treated like an array index with range: 0 <= pageNumber < pageCount.
    
    #### Returns Promise<[DataTable](https://help.tableau.com/v0.0/api/embedding_api/en-us/reference/interfaces/DataTable.html)\>
    
    A DataTable containing the requested page. The number of rows returned can be less than the page size at the end of the data.
    
    ```
    const pageRowCount = 200;const dataTableReader = await worksheet.getSummaryDataReaderAsync(pageRowCount, options);for (let currentPage = 0; currentPage < dataTableReader.pageCount; currentPage++) {  const currentPageDataTable = await dataTableReader.getPageAsync(currentPage);  // ... process current page ...}await dataTableReader.releaseAsync();
    ```
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:245

### releaseAsync[](#releaseasync)

- releaseAsync(): Promise<void\>[](#releaseasync-1)
    
    Release all resources held by the DataTableReader. Calling this when done with the DataTableReader is required practice as it frees up resources. Calls to getPageAsync() after releaseAsync() will throw an exception.
    
    #### Returns Promise<void\>
    
    - Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:273

## Properties

### `Readonly`pageCount[](#pagecount)

pageCount: number

#### Returns[](#returns)

The number of pages in the full data table. The last page could be a partial page.

- Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:224

### `Readonly`totalRowCount[](#totalrowcount)

totalRowCount: number

#### Returns[](#returns-1)

The number of rows in the full data table.

- Defined in packages/api-external-contract-js/src/ExternalContract/Shared/DataTableInterfaces.ts:219

### Settings

Member Visibility

- Protected
- Inherited
- External

ThemeOSLightDark

### On This Page

Methods

[getAllPagesAsync](#getallpagesasync)[getPageAsync](#getpageasync)[releaseAsync](#releaseasync)

Properties

[pageCount](#pagecount)[totalRowCount](#totalrowcount)