The Tableau Refresh Kit can refresh tableau data sources through Rivery action rivers using their API. Instead of trying to update these sources on a schedule within tableau, this kit can be scheduled to run directly after a river seamlessly adding the latest and greatest data in the front end dashboard.
This Kit includes…
- Three action rivers to refresh the data:
- Sign in/Retrieve API Token
- Get Datasource ID(s)
- Refresh Datasource(s)
- Master logic river that orchestrates these actions to refresh the selected data sources (see screenshot below)
Minimum RPU Consumption: 1
Configuring this Kit for use
Variables
In this Kit, there are four River variables that need to be initialized. Adding values to these already created parameters can be done within the “Refresh Datasources Logic” river by clicking the top right “Variables” button (See screenshot below). Use the below URIs as examples for the first three variables.
https://10ay.online.tableau.com/api/3.12/auth/signin
https://prod-useast-a.online.tableau.com/#/site/rivery/home
- {Pod_Name} – The pod name is the first portion of the Tableau Online server address. In the first example URI, the pod name is “10ay” and in the second, it is “prod-useast-a”.
- {Tableau_API_Version} – The API version is the REST API version number within which the request exists. In the first example URI, the API Version is “3.12”. Navigate here for more information on finding the correct API Version.
- {Content_URL} – The content-url is the value that appears after /site/ in the browser address bar. In the second example URI, the content-url is “rivery”.
- {Datasource_Name} – The datasource name is the name of the datasource which the user is trying to refresh. To find the name, start the process of creating a new dashboard and the first step will have a list of all the data sources. If selecting a name with spaces, use a ‘+’ in exchange of the space(s).
There are three additional river variables Token, Site, and ID that do not need to be initialized. They will be given values throughout the river running process.
Connections
There are two keys that need to be added when creating the Tableau connection. See the screenshot below for an example of how the Tableau connection screen should look. The username and password combination has to correspond to a user with an Admin status such as ‘Site Admin Explorer’.
- {personalAccessTokenName} – This is the name of the user when signing in.
- {personalAccessTokenSecret} – This is the password of the user when signing in.
Directions
Although this Kit can be used in a number of different ways, its intended purpose is to refresh a data source within Tableau where the underlying data has been updated through rivers. The easiest way to do this is to add the master logic river to the end of another logic river that updates data. This way, when the data river is scheduled, it will automatically push the new data to the connected data source keeping the dashboards as up to date as possible in Tableau. As an exmaple, the screenshot below shows the master logic river of the Facebook Ads Kit with the Refresh Datasources Logic river added. Everytime time the Facebook Ads Kit is run, the Tableau data source will be refreshed.
The current configuration of this kit allows for one data source to be refreshed at a time. If there is a need to update a group of data sources at once, this kit can still be used, but will need some reconfigurations. In the River that gets the data source ID, there is a ‘filter’ parameter which filters the results for a single name. Using the Tableau API documentation here, the filter parameter can be changed to look for multiple data source names or specific tags applied to data sources. This presentation has steps to add tags to published data sources and how to change the filter to look for these tags.
A second option to refreshing more than one data source is creating a duplicate of the “Refresh Datasources Logic” river. The only next steps are to update the variables in the newly created river and add it to the logic river that creates/updates the second data source. This flow can be done however many times are necessary.