3 Replies Latest reply on Mar 25, 2018 2:29 PM by nataraj.vijayanagaram

    Dashboard Selection using API


      Hello All,


      I am trying to use the javascript api to change dashboard selection / view.


      I have below code but it is not working..function - switchToMapTab.. Can someone please advise..


      <!DOCTYPE html>





          <title>Basic Embed</title>


          <script type="text/javascript"


          <script type="text/javascript">

              function initViz() {

                  var containerDiv = document.getElementById("vizContainer"),

                      url = "http://public.tableau.com/views/WorldIndicators/GDPpercapita",

                      options = {

                          hideTabs: true,




                  var viz = new tableau.Viz(containerDiv, url, options);

                  // Create a viz object and embed it in the container div.




              function switchToMapTab() {

        workbook.activateSheetAsync("GDP per capita map");




      function selectSingleValue() {












      <body onload="initViz();">

          <a href="#" onClick="selectSingleValue();">selectSingleValue</a><br>

          <a href="#" onClick="switchToMapTab();">switchToMapTab</a><br>



          <div id="vizContainer" style="width:800px; height:700px;"></div>