6 Replies Latest reply on Jul 22, 2019 7:42 PM by Umer Khalid

    Example of getData for Story?

    Anthony Lipphardt

      I have a Tableau Public visualization (https://public.tableau.com/profile/dataviz8737#!/vizhome/7_U_S_DrugPoisoningMortality/USDrugPoisoningMortality) from which I would like to get the data using the JavaScript API. I have seen the code examples for grabbing data from Worksheets and Dashboards, but not for Stories.


      I can get to a list of Worksheets using the following code:


      listOfWorksheets = viz.getWorkbook().getActiveSheet().activeSheet.getActiveStoryPoint().getContainedSheet().getWorksheets();


      But then if I try to iterate through that array of worksheets I am unable to get the underlying data for those worksheets:


      listOfWorksheets[0].getUnderlyingDataAsync(options).then(function(t){ console.log(t.getData()); });


      I keep getting an error that getUnderlyingDataAsync is not a function. Is there a good example of using getData() for stories?