Get Data

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.

<!DOCTYPE html>
        <title>getData() Basic Example</title>
		<script type="text/javascript" src=""></script>
        <script type="text/javascript">
            var viz, sheet, table;

            function initViz() {
		var containerDiv = document.getElementById("vizContainer"),
                    url = "",
                    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

                       table = t;
			var tgt = document.getElementById("dataTarget");
			tgt.innerHTML = "<h4>Underlying Data:</h4><p>" + JSON.stringify(table.getData()) + "</p>";

    <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 id="vizContainer" style="width:600px; height:600px;"></div>
        <div id="dataTarget"></div>

Thanks for your feedback!Your feedback has been successfully submitted. Thank you!