community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Pull Dashboard Image from Tableau Server

Asteroid

 

We are trying to automate a daily email that would pull in an image of the current Tableau Dashboard. 

 

I understand there is the Tableau Subscription models, but we need to be able to provide other information in the email, that can only be done with Alteryx. 

 

We are trying using both the Download tool, and the Image tool, as I know you can enter the Tableau URL ending in .png to open the web page as an image. We have had some success with images from Google, but have not had success with pulling images from our Tableau Server. 

 

Has anyone here done this successfully? 

Alteryx Certified Partner
Alteryx Certified Partner

I can only imagine the difference between this and google is the security on the Tableau server. We'll have to somehow figure out how too pass the login credentials into the download tool but I am not sure where to start with this.

I'll have a chat with some of my colleagues and see what we come up with.

 

Ben

Asteroid

Thanks, Ben.

 

I do have the output from the run that was successful before when using a random internet image and fails on Tableau .png link. I've entered several variations of my credentials in the download tool, and I'm using the Text to Columns(Actually, rows) tool to parse out the DownloadHeaders.

 

What I've noticed is that I get HTTP/1.1 302 Found anywhere that Server: Tableau. I get HTTP/1.1 401 Unauthorized anywhere that Server: Apache, which is where our Tableau front-end is apparently hosted.

 

So, it sounds like there is some sort of permissions issue with the server itself rather than Tableau. Not sure how to remedy this. I am not the Tableau Admin. I'm not sure what other information is in these downloaded headers, so I'm hesitant to upload the output I have, but if a specific point of the data would help, let me know and I can post that.  

 

EDIT: I am a Tableau Site Admin, but not a Server Admin. 

Alteryx Certified Partner
Alteryx Certified Partner

I think you would need to look deeper into the Tableau REST API. In order to pull data down you need to get an authentication token (the best way to see this is by investigating the 'Publish to Tableau Server' macro) and pass this information as part of the 'headers' within the download tool.

If you check out the documentation here it may help on how to construct the URL: https://onlinehelp.tableau.com/current/api/rest_api/en-us/help.htm#REST/rest_api_ref.htm#Query_View_...

Again I'll keep this on my mind but I can't promise this will be a quick one.

 

Ben

Bolide

@FFFool,

 

Your Tableau Server has a plethora of API endpoints that can be used to get information about your projects, workbooks, views, users, etc.  One that may be particularly helpful for you is the Query Workbook Preview Image API.

 

Also, the Publish to Tableau Server tool has a nifty output option for requesting an authentication token that can help do some of the legwork for getting the images (or using any of the API endpoints, for that matter).  I was able to get the images pretty quickly thereafter with the download tool.  I've attached an example workflow that should do the trick once you configure the Publish to Tableau Server tool.  It will return a list of the workbooks from a specific site so that you can get the workbook ids for the specific dashboard(s) that you'd like images for.

 

Workflow Preview..

canvas_preview.pngTool Flow

And with results...

Results.pngResults 

The images, at this point, should be ready to use in the reporting tools, etc.  Bear in mind that these are preview images and likely won't retain quality at higher resolutions.  You'll have to be the judge - I didn't view any of them enlarged.

 

The Publish to Tableau Server Tool should be configured like so...

 

 Publish_Out.pngConnectionPublish_Con.pngOutput

This may not be exactly what you're looking for, but it's a quick and easy way to get some dashboard images into your Alteryx reports/emails automagically ;-)

 

p.s. You might try your URL .png method in the download tool with the auth header token from the Publish to Tableau Server tool - you never know, it might just work.  If it does please let me know! 

 

Cheers,

Taylor

 

Bolide

@FFFool@BenMoss,

 

I forgot to mention, the only header needed to use Tableau's REST API is an authentication token.  For example:

 

X-Tableau-Auth : 12ab34cd56ef78ab90cd12ef34ab56cd

 

The Publish to Tableau Server tool's 'request authentication token' option provides exactly that - which you can subsequently use in the Download tool...

 

Hope that helps

Asteroid

@Coxta45

 

Thanks for this suggestion and direction. It's definitely very close to what I want. Unfortunately, you are correct in that the preview image really does not scale well, and for the most part ours are not cached frequently enough to be updated when pulled. I wasn't able to get the URL to work properly with the .png instead of previewImage, as I got a 404 error.

 

I'm going to take the knowledge I've gained here and set off following this post from the Tableau Community to see where I end up.

https://community.tableau.com/thread/163443?start=0&tstart=0

 

I will report back when I find a proper solution.

 

Thanks again! 

Bolide

@FFFool,

 

Tableau 10.2 has a new API version (2.5) which has the shiny new Query View Image endpoint that @BenMoss mentioned.  

 

Having said that, if your Tableau server is 10.2, you could keep going with the workflow that I posted, and pass the workbook id to the Query Views for Workbook endpoint to get a specific view id - which you would pass to the Query View Image endpoint to download the image.  The endpoint returns a "live", high resolution image of the view.  Once you've gotten the view id(s) that you need, you'll be able to just make a single call to the Image endpoint with each run of the workflow.

Alteryx Certified Partner
Alteryx Certified Partner

Awesome, I have access to a 10.2 server and developed as per your suggestion and the output works great. Super good quality images also!

 

Thanks for the learning experience!

 

Will post the workflow once i've cleaned it up a bit :)

Bolide

@BenMoss@FFFool,

 

Awesome!  We're still running 10.1 on our Tableau servers.  Otherwise, I'd have been happy to build an example.  Thanks, @BenMoss for finishing the idea! 

 

Teamwork makes the Dreamwork ;-)

Labels