1 Reply Latest reply on Aug 29, 2016 4:58 PM by diego.medrano

    Navigate through Story Board Points with Javascript

    Jonas Seemann

      Hi everyone,

       

      I am not a really JavaScript programmer. So please excuse me if the solution seems obvious to you.

       

      I am currently working on a project. We have an embedded Tableau dashboard, hosted on our server and implemented as an iframe on a website. The dashboard itself contains multiple Storyboards sheets. On every storyboard sheet we have multiple storyboardpoints.

      Furthermore we have a HTML menu.

       

      If the user clicks e.g. on the menu point "Sales", the "Sales"-storyboard sheet opens.At this point everything works fine.

      Now we always want the second point to be set as "default", e.g.

      1. Sales-Storyboard
        1. Sales Germany
        2. Sales UK
        3. Sales Greece

      In this Case, "Sales UK" should be seen.

       

      I already managed to write two functions. One functions calls the sheet "Sales", another function calls the story board point.

       

      function switchView(sheetName) {

          workbook.activateSheetAsync(sheetName);

      };

       

      function activateStorypoint(storypointIndex){

              sheet = workbook.getActiveSheet();

              sheet.activateStoryPointAsync(storypointIndex);

      };

       

      I fail at combining these functions together. I think it is because the functions executes AFTER the functions get values for their variable. In this case, the second function fails.

      Does anyone have similar issues or maybe a solution?

       

      After some googling I found something called "Callback functions" but I did not really understand these. If this can be a solution, may someone please explain this to me.

       

      Thank you and best regards from Germany,

      Jonas