0 Replies Latest reply on Dec 10, 2015 12:01 PM by dawit.semma

    How can I get the data that's being bound to each worksheet

    dawit.semma

      I have the code below to embed tableau dashboard into my page

       

      function initializeViz() {

            var placeholderDiv = document.getElementById("tableauViz");

             var url = "http://public.tableau.com/views/WorldIndicators/GDPpercapita";

            var options = {

                       hideToolbar: true,

                      onFirstInteractive: function () {

                      workbook = viz.getWorkbook();

                      activeSheet = workbook.getActiveSheet();

       

                     if (activeSheet.getWorksheets){

                       published_sheets = activeSheet.getWorksheets();

       

                       for (i=0;i<published_sheets.length;i++){

       

                       published_sheets[i].getDataSourcesAsync().then(

       

                            function (e){

                                 console.log(e);

                                 for(j=0;j<e.length;j++){

                                     ds_name = e[j].getName();

                                     ds_is_primary = e[j].getIsPrimary();

                                     fields = e[j].getFields();

                                   }

                                   }

                            ); } }

                              

                       //IS THERE A WAY TO GET THE DATA THAT'S BEING BOUND TO published_sheets[i]

                 } };

        viz = new tableau.Viz(placeholderDiv, url, options);

      }

       

      How can I get the data that's being bound to each worksheet from tableau server? the same data table result when you click on  -> Export -> Data -> Summary/Underlying. (Summary)

       

      Something like (usiinig the example above)

       

                   var worksheetdata =  published_sheets[i].getData();

       

      Regards,