1 Reply Latest reply on Jan 7, 2019 11:51 PM by Lewis Wong

    [Python&Tableau]Can workbook be replaced by another data source?

    alice mok

      Suppose I created a workbook for a graph (column is called y while x for the row), which is connected to data source A (i.e. a.xlsx)

       

      Can the workbook be connected to another data source (b.hyper), so that the graph can be changed??? I want to perform this by REST API or Document API using python...

       

      Like the following codes:

      from tableaudocumentapi import Workbook

       

      sourceWB = Workbook('wb.twb')

       

      sourceWB.datasources[0].connections[0].extract = "b.hyper"
      sourceWB.save_as('updated_wb.twb')

       

      Thanks a lot!