2 Replies Latest reply on Jun 7, 2017 9:32 AM by Sylvain Martel

    Opening a dashboard using URL that includes a parameter value (not a filter)

    Sylvain Martel

      Hi

       

           trying to fnd the way to open a Dashboard with an URL that includes a parameter name and value. (NOT a filter)

       

           That parameter is bind to a store proc that is returning data based on the value of the parameter.

       

           So depending on the value in the URL, data will be different on the dashboard

       

           Anyone was succesfull doing this?

       

      Thanks

        • 1. Re: Opening a dashboard using URL that includes a parameter value (not a filter)
          sunil.sachdeva

          Hi,

           

          Option 1:  You can use Javascript API and pass parameters and values.

          something like:

           

          <script type="text/javascript" >

          function initializeViz() {

           

           

            var year = document.getElementById("V_YEAR");

            var  mnth = document.getElementById("V_MNTH");

            var placeholderDiv = document.getElementById("tableauViz");

            placeholderDiv.style.position = "absolute";

            placeholderDiv.style.left = 100+"px"

            placeholderDiv.style.top = 300+"px"

           

           

          var url = "https://dev-server.com/t/site_name/views/Dashboard_name/Workbook_name";

            var options = {

           

              width: 1500,

              height: 1000,

              hideTabs: true,

              hideToolbar: false,

            "Parameter_1": year.value,

            "Parameter_2": mnth.value,

            onFirstInteractive: function () {

                workbook = viz.getWorkbook();

                activeSheet = workbook.getActiveSheet();

              }

            };

           

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

          }

           

           

          function exportToPDF() {

                      viz.showExportPDFDialog();

                  }

           

           

          Option 2:  embedded in url, something like:

          https://dev_server.com/t/Site_name/views/Dashboard_name/view_name?Parameter_name=Parameter_value

           

          I have used option 2 with passing parameters to custom SQL but didn't test with stored proc, but i think it should work with stored proc as well.     

          Hope that helps.

          • 2. Re: Opening a dashboard using URL that includes a parameter value (not a filter)
            Sylvain Martel

            Hi

             

                 Thanks sunil.sachdeva for you reply.

                 It helped me finding the solution/problem for this question.

             

                 So basically, syntax to call a Tableau document with a parameter in the UR is : https:Tableau_server/site/views/DB_name/view?Parameter_Name=Value

             

                 But in my case it wasn't working and here is why.

             

                 Both Tableau parameter and parameter from the strore proc were having the same name : EmployeeKey

                 To make it work you have two options :

             

                      Rename the parameter

                      or

                      use the following syntax ?Parameters.Parameter_name=value

             

                 In the last option, using th keyword "Parameters" seems to tell Tableau to use it's parameter

             

            Hope this will help someone else

             

            regards