Skip to content

Instantly share code, notes, and snippets.

@mikexine
Created November 3, 2017 12:28
Show Gist options
  • Save mikexine/3d853f039e1e43ab8a8b274c17f979f0 to your computer and use it in GitHub Desktop.
Save mikexine/3d853f039e1e43ab8a8b274c17f979f0 to your computer and use it in GitHub Desktop.
Autorefresh a dashboard on Tableau Server
<html>
<body>
<script type="text/javascript">
getTableau = function() {
return parent.parent.tableau;
};
getCurrentViz = function() {
return getTableau().VizManager.getVizs()[0];
};
getCurrentWorkbook = function() {
return getCurrentViz().getWorkbook();
};
initAutoRefresh = function() {
console.log("AutoRefresh running");
tableau = getTableau();
workbook = getCurrentWorkbook();
viz = getCurrentViz();
getCurrentViz().refreshDataAsync();
};
window.setInterval(function() {
initAutoRefresh();
}, 5000);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment