1
votes

I am trying to create a new visualization (sheet) in a tableau online workbook via javascript API or by another language. Not by using Tableau Desktop or "manual" interaction into Tableau Online.

I know that the JS API allows me to control (filter, display, etc.) existing visualizations, and the SDK can extract data and publish, but my need is to "create" a new visualization into an existing workbook.

Is there a way to do this?

2
Just curious what the use case for this would be?Sam M
For example building a bar chart from "scratch" programmatically, with no need of mouse interaction. This would allow automated, detailed construction of visualisations in Tableau.Miguel Vazq
Gotcha. I don't work for this company, nor have I used their tools yet, but Interworks is a well known Tableau partner. They have a Workbook SDK product you might look in to. powertoolsfortableau.com/tools/workbook-sdkSam M

2 Answers

3
votes

The only methods of creating Tableau content that I'm aware of is using Tableau Desktop or Web authoring of something that is already published.

2
votes

I explain how to do what you're asking on the blog post linked below. You can use Python with Jinja2.

The basics ...

  1. Create a template of your XML.
  2. Put in the necessary Jinja2 templating language code into your template as placeholders for the data and XML that needs to be rendered by Jinja2. You can render data conditionally as well.
  3. Create a CSV file that specifies what the Python program needs to know to create your workbooks.
  4. Run your Python application to generate a TWB file based on your template and input file. You can also easily create TWBX by zipping the TWB and data together.

The link gives code examples and an example CSV file for specifying your input.

https://www.linkedin.com/pulse/create-tableau-visualizations-programmatically-allan-thompson