-
06/07/2023
Tableau Cloud and Server allows the users download manually data from a dashboard or a view. I received some requests during last year about how to automate this process. So here you have the procedure using Alteryx and Python, using Tableau Server REST API
According to Tableau, with the Tableau Server REST API you can manage and change Tableau Server, Tableau Cloud site, and Prep Conductor resources programmatically, using HTTP. The API gives you simple access to the functionality behind Tableau data sources, projects, workbooks, site users, sites, flows, and more. You can use this access to create your own custom applications or to script interactions with Tableau resources.
You can find more information here:
https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api.htm
So first Step will be activate a token in order to log in Tableau Cloud or Server using REST API. Go to your configuration page on Tableau Cloud or Server and activate a Personal Token:

Once you have it, open Alteryx, create a new workflow and drag the Python Tool to the Canvas. Add a Browser Tool to see the Data you are going to extract

Click on the Python tool and add the following code. First part will import the needed Python Packages. Customize tableau_server_config with the name of your Tableau Cloud Site or Tableau Server Site and your token

Once done, add the following code. First you will get the id of all your Views and then you will need add the code to get data for that View Id.

At this time, run the workflow and you will get the data of the view

In order to automate, publish the workflow to Alteryx Server and schedule the execution of the Workflow. You can even automatize sending an email with the data.
That’s All! Hope it’s useful for you 😉

