---
schema_version: "1"
id: 62bc7ce1a79f31e203743cf7277ddef7f23e1c093280b88ed330c11576a4e90a
title: Get Data
collection: tableau
version: next
locale: en-us
portal_url: https://docs.salesforce.com/tableau/next/en-us/api/js_api/JavaScriptAPI/js_api_samples_get_data.md
canonical_url: https://help.tableau.com/v0.0/api/js_api/en-us/JavaScriptAPI/js_api_samples_get_data.htm
source_site: help.tableau.com
content_type: documentation
content_hash: d2992972d1e28fd0ad7229c0edfd8ed853c156d03eda479a1d9788655c06444b
description: Important changes for the Tableau JavaScript API
---
[Skip to main content](#main-content)

# Get Data

**Important changes for the Tableau JavaScript API**

As of February 2024, the Tableau JavaScript API is deprecated. Use the Embedding API v3 instead for embedding interactive views into web pages and applications. For guidance on embedding Tableau views, see the [Tableau Embedding API v3 Help](https://help.tableau.com/current/api/embedding_api/en-us/index.html).

Get the underlying data for the currently active sheet.

To download data for a workbook, your Tableau Server user account must have the Download Summary Data and Download Full Data permissions.

  

  
  
Get Data

  

* * *

  

```
<!DOCTYPE html>
<html>
    <head>
        <title>getData() Basic Example</title>
		<script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script>
        <script type="text/javascript">
            var viz, sheet, table;

            function initViz() {
		var containerDiv = document.getElementById("vizContainer"),
                    url = "http://public.tableau.com/views/RegionalSampleWorkbook/Storms",
                    options = {
                        hideTabs: true,
                        hideToolbar: true,
                        onFirstInteractive: function () {
                            document.getElementById('getData').disabled = false; // Enable our button
                        }
                    };
                viz = new tableau.Viz(containerDiv, url, options);
            }

            function getUnderlyingData(){
                sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get("Storm Map Sheet");
		 // If the active sheet is not a dashboard, then you can just enter:
		 // viz.getWorkbook().getActiveSheet();
                options = {
                    maxRows: 10, // Max rows to return. Use 0 to return all rows
                    ignoreAliases: false,
                    ignoreSelection: true,
                    includeAllColumns: false
                };

                sheet.getUnderlyingDataAsync(options).then(function(t){
                       table = t;
			var tgt = document.getElementById("dataTarget");
			tgt.innerHTML = "<h4>Underlying Data:</h4><p>" + JSON.stringify(table.getData()) + "</p>";
                });
            }
        </script>
    </head>

    <body onload="initViz();">
        <div class="page-header">
            <h1>getData() Basic Example</h1>
            <p>Click the "Get Data" button to get underlying data for the viz.</p>
            <button id="getData" onclick="getUnderlyingData()" class="btn" disabled>Get Data</button>
        </div>
        <div id="vizContainer" style="width:600px; height:600px;"></div>
        <div id="dataTarget"></div>
    </body>
</html>
```