Since writing this post I found an alternative and improved way to publish a Hyper file to the Tableau Server from Alteryx, using the Alteryx Run Command.
For those Alteryx and Tableau Server users the ability to publish Tableau Data Extract (tde) files directly from Alteryx to the Tableau Server is a huge benefit for report automation. There are a number of good posts already published advising how this should be done, such as this excellent guide from Interworks. In this post I’ll replicate some of that post, should that link break at some point, and also add to it where I ran into difficulties.
To publish to Tableau Server from Alteryx requires using Tableau’s tabcmd. I expect it’s also possible using the REST API from Tableau but I was unable to work it out, so this post will focus on the tabcmd solution, which, in my opinion, is far simpler. If you’re not a Tableau Server administrator in your role you may need to install tabcmd.
How to use Alteryx Events to publish to Tableau Server
Do the following to set up a workflow to publish directly to Tableau Server from Alteryx, using the workflow configuration Events:
Open the Alteryx workflow that creates the tde / hyper file.
In the Events section of the Workflow – Configuration add a Run Command. Also check ‘Enable Events’.
Choose “After Run Without Errors”
Enter the location of the tabcmd.exe in the Command box
Enter the command line to execute in the Command Arguments section. I recommend entering this into Notepad first and copying into the Command Arguments section.
Example tabcmd command line:
publish “\\NetworkLocation\TableauDataToPublish.tde” -s TableauServer -u UserName -p Password -t TableauSite -o -r “Data Sources”
Important things to note about the string:
- publish = the tabcmd command
- -s = tells tabcmd which Tableau Server to use. This doesn’t need to be the “https://TableauSite” URL, it is better as the server name as entered to the Tableau Postgres database
- -u = the username to login to the Tableau Server (also needs to be set up on the Tableau Server)
- -p = the password to login to the Tableau Server
- -t = the name of the Tableau Site on the Tableau Server to use
- -r = the project name to publish to. It publishes to the Default project if not included.
- -o = Overwrite the existing tde file with the same name
There are a number of things that can be specified in the tabcmd command string. The Tableau help documentation has a comprehensive list of those items.
Ensure the Timeout (in seconds) gives enough time for the TDE file to publish to the Tableau Server
Now it’s complete, run the workflow and you should no longer need to manually publish TDE / hyper files to Tableau Server.
- If using the Alteryx server the Alteryx service account will need setting up on Tableau Server with a Publisher role.
- If tabcmd fails use the tabcmd.log file to see the error message(s). Alteryx will only tell you it failed, the tabcmd.log will tell you why it has failed. This is copied from the tabcmd overview on the Tableau website advising where to find the tabcmd.log:Status messages and logs. When a command is successful, tabcmd returns a status code of zero. A full error message for non-zero status codes prints to stderr. In addition, informative or progress messages may print to stdout. A full log named tabcmd.log that includes debugging, progress, and error messages is written to C:\Users\<username>\AppData\Local\Tableau.