8 Replies Latest reply on Oct 6, 2014 12:09 AM by Karthik Venkatraman

    Implementing Tableau API in webpage

    Karthik Venkatraman

      Hi,

       

      I have a web application and a set of tableau dashboards. I want to pass data from the web page to the tableau dashboard. I have to implement tableau API for this and I dont know how to do it as I am not well versed in JavaScript.

       

      All I want is to know how I have to pass the value from web page and implement tableau api for it.

       

      Can anyone please help me with this by helping me out with a sample code?

       

      If I get a sample code on how to use tableau api for getting data from web page, I can work on it and can continue with it.

       

      Thanks in advance

       

      Karthik Venkatraman

        • 1. Re: Implementing Tableau API in webpage
          Russell Christopher

          Hey Karthik -

           

          This is not a core scenario that Tableau focuses on (passing arbitrary external datasets directly to Tableau vs. using a more static data model). Can you add a bit more context? It sounds like you may need to use the Tableau Extract API for this work....

          • 2. Re: Implementing Tableau API in webpage
            Karthik Venkatraman

            Hi Russell,

             

            I need to implement tableau api to get value from the web page and need to pass it to the tableau custom sql parameter.

             

            Say for instance, I will have a drop down and the user selects the value from that drop down. That drop down value will serve as the parameter for the custom sql I have in tableau data source.

             

            I am aware that I need to use tableau api for this scenario. However I am not well versed in Javascript. So i am not able to implement the code for getting the value from the drop down using tableau API.

             

            i hope this will clearly explains you my problem.

             

            Regards,

            Karthik V

            • 3. Re: Implementing Tableau API in webpage
              Russell Christopher

              Hi Karthik -

               

              What you want to do is fully documented in help. Have you taken a look? API Reference

               

              A second example which might be helpful is here: The "Render Viz with More Options" item sets the value of a parameter under the covers.

               

              To be honest, the fact that you don't write JavaScript is going to make this task a challenge for you. While the people who populate the forums are more than happy to assist with our JavaScript API, we assume that the person is conversant with web development technologies necessary to implement same. Perhaps you can get a co-worker to help you?

              • 4. Re: Implementing Tableau API in webpage
                Karthik Venkatraman

                HI Russell,

                 

                I have looked at the API Reference guide in initial stage itself.

                 

                The problem we have is ours is a newly startup company with only 5 people and we dont have more employees. I am the one and only one who has to take care of this work as we dont have much employees.

                 

                I have sound knowledge in asp.net and other web technologies except javascript. So I you let me know how i have to do it I will be able to figure it out. If you have any sample something like in a html page you can have a heading and using tableau api javascript you can get that heading text, it will be enough for me. Using that I can do the rest of the coding.

                 

                Can you help me out?

                • 5. Re: Implementing Tableau API in webpage
                  Karthik Venkatraman

                  Hi Russell,

                   

                  Can you tell me which function I have to use for getting the data from the webpage and pass it to the tableau?

                   

                  I have designed a custom sql parameter in my data source connection something like

                   

                  "

                  select * from tbl_project where ProjCode = <Parameters.ProjCode>
                  
                  

                  "

                  I have a select field in my html page that will enable the user to select the projcode. Below is the code for that

                   

                     function GetProjCode(t) 
                     {
                       var y=document.getElementById("txt");
                       y.value = t.value;
                     }
                  
                  

                   

                  Using the above code I will be able to get the data from the select option, however I dont know how I have to pass that variable projcode to tableau API and which function I need to use so that I can get that variable name as the parameter for the custom sql parameter.

                   

                  If I now the function and how to pass the variable, it will be easy for me.

                   

                  Can you help me out in this work?

                  • 6. Re: Implementing Tableau API in webpage
                    Russell Christopher

                    I forgot to paste in the second example - it has code you can use:

                     

                    Tableau v8.2 JavaScript API

                    • 7. Re: Implementing Tableau API in webpage
                      Karthik Venkatraman

                      Hi Russell,

                       

                      I have figured out till getting the value from webpage.. But how to pass it to the tableau parameter.

                       

                      Do we need to use the getParameterAsync() function for this?

                      • 8. Re: Implementing Tableau API in webpage
                        Karthik Venkatraman

                        HI Russell,

                         

                        I have figured it out.

                         

                        I used the changeParameterValueAsync(0 function to pass the parameter name to my tableau file and it has worked out successfully.

                         

                        Thanks for your help.

                         

                        Regards,

                        Karthik V