tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
657 stars 422 forks source link

Feature request: Export a select/particular sheet in a Dashboard #1132

Open cjvegi opened 2 years ago

cjvegi commented 2 years ago

Help Requested Some of my views have multiple sheets. Does the functionality exist where I could export a select Sheet to CSV/excel from a given View? I could not find the resources either in the documentation or in the community. So, any help/guidance is helpful.

anyoung-tableau commented 2 years ago

The Tableau REST API doesn't allow for specifying the specific sheet when exporting data from a Dashboard view. It will always return the data from the first sheet on the dashboard. Is there any reason why you aren't exporting the data from your desired sheet directly instead of from the dashboard on which it exists?

cjvegi commented 2 years ago

@anyoung-tableau Thanks for your response. The sheets are part of the dashboard & having them published individually or as part of the same workbook can create more confusion/UX for end-users accessing the dashboard.

Yes, I can get data from a specific sheet, but to do that, I need to 1. Need to Unhide them 2. Publish them as different workbooks. Most often than not, this results in added maintenance. Currently, this is the procedure I am doing, where I am putting all sheets that I need to extract into an "API Workbook" that isn't exposed to the everyday user.

Hence, I was looking to extract a sheet within a dashboard and avoid publishing the sheet independently and any added maintenance. Hope this helps.

saadbahir commented 1 year ago

Hey @anyoung-tableau If i understand correctly, we can query all sheets within a workbook and then query the data from any specific sheet?

jacalata commented 1 year ago

@saadbahir yes - check out the example code in https://github.com/tableau/server-client-python/blob/master/samples/export.py

jacalata commented 1 year ago

I suspect that implementing this might require/be improved by implementing this request as well: https://github.com/tableau/server-client-python/issues/1045

saadbahir commented 1 year ago

@jacalata I check the code and it seems that the script exports the data of the first available sheet because the API doesn't expose the data of the other hidden sheet within a view