top of page

TABLEAU ONLINE - METADATA EXERCISE #1

Updated: May 24, 2023

You saw the title but then you got nervous... Don't go anywhere we're doing this together!

When I start talking about Metadata I know people get excited but then learning something new can be overwhelming and can cause us all to stop and second guess. We're going to take this one step at a time and I am going to make it as simple as I can. The end result, you drop in your own Tableau Online data to the dashboard template above, and there you go, a ready-built dashboard for users to explore.


If you are thinking, what is Metadata and where do I begin? I have just the video for you to watch. Back in 2021, Anya Prosvetova introduced us during HER DATA LEARNS: METADATA API. This not only inspired me but helped me solve a practical issue for my organization at the time. It has taken me some time but I finally have a Sandbox Tableau Online account, Query, and Dashboard Template to share as we walk through this first query together.


Before I jump in let's talk a bit about the Sandbox Tableau Online account I am using. This was all possible to create thanks to the Tableau Developer Program. I was able to create a free Tableau Online account for the purpose of learning. Do you want to know more? Check out the link to join the program for free and get started.


Now, let's talk about GraphiQL. What is GraphiQL? "A query language for your API

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools."


To jump to GraphiQL and query against your Tableau Online account you would replace everything after the # in your Tableau Online URL with metadata/graphiql/(see the example below).



You should see the window below if you used the correct URL.

If you made it this far, WOW! You already have accessed the GraphiQL and you are one step closer to querying against Tableau Online.


The first exercise in Metadata that we will run is the query below. Copy and paste this script into GraphiQL and hit the play button.

query tablesInDatabase2{
  databases{
    name
    connectionType
    isEmbedded
    tables {
      name
      downstreamWorkbooks{
        name
        projectName
        owner{
          name
          username
        }
      }
    }
  }
}

If it ran correctly you should see the window below appear. If so, well done. You just ran a Metadata API query against Tableau Online. Now, we can jump to the exciting and sweet stuff.

These last few steps are simple. We right-click, select all and paste it into Notepad or Notepad++. Ultimately we want to save this file as a JSON but can't automatically from GraphiQL. I prefer the Notepad++ option myself. Once you save the file as a JSON you should notice the text colors change. Saving as a JSON supports the node structure which will be important when we pull this into Tableau to create the dashboard.

Here is why it is important. When you pull the JSON file into Tableau, the first window you will see is 'Select Schema Levels'. I always check the top box to include all Schema Levels.

Once you select ok, you are connected to the JSON file and just successfully pulled Metadata and connected it to Tableau Desktop. From there run wild with creating a dashboard and insights you might need. To save you some of the work I created a Tableau template for you to use, DATA Connections available on Tableau Public for download. Just download the workbook, replace my data source with your own JSON file, and you are ready to go.


Now, that wasn't so scary, right?


Let's talk about the practical uses of this dashboard. The purpose of this dashboard is to summarize the use of data connections within published workbooks to Tableau. In short, this is useful to have a catalog of what dashboards or workbooks on Tableau Online are connected to what. The downside is, Initial SQL and connections to Stored Procedures in SQL are not supported by metadata. This dashboard is an initial step but not all-inclusive of SQL connections. What that means, there is still a blind spot in the Tableau Metadata and Tableau Catalog. If you are connecting using Initial SQL, or Stored Procedures, you need another form of documentation.


Coming up next, I'll show how I was able to pull all of the Custom SQL connections...

488 views

Recent Posts

See All
bottom of page