QBoard » Advanced Visualizations » Viz - Tableau » Using Tableau Javascript API on Tableau Dashboard Loaded through aspx

Using Tableau Javascript API on Tableau Dashboard Loaded through aspx

  • I have a non-public Tableau Dashboard that I load through aspx file, which supplies the required authentication, username and password, and allows the site visitor to view the tableau on the website, with the ticket it receives.

    So, now, I want the Tableau to load on the website with filters already applied through the Javascript API.

    Or, how can I use the "onFirstInteractive" option of the Javascript? The problem is I don't need to use the Javascript API to load the Tableau but just need it to apply filters on the Dashboard.

    function tableauFilter (){
    var placeholderDiv = document.getElementById("viz2"); // Don't need this
    var url = "https://public.tableau.com/views/Test_1228/Dashboard1" // Don't need this either
    var options = {
    onFirstInteractive : function(FilterName,Value){   //This is what I want to be able to use  
        activesheet = viz.getWorkbook().getActiveSheet();

    Any help is highly appreciated.

     
      October 12, 2021 1:46 PM IST
    0
  • You can actually run any filter function after initializeViz(), which instantiates the embedded viz, instead of within onFirstInteractive()--though you'll want to declare your sheets variable here.  Just put any filter functions within the document ready.
      December 3, 2021 12:36 PM IST
    0
  • I would have to test this out myself for confidence, but I'm fairly sure that the Javascript API can only be used to apply filters to a dashboard that has been loaded using the Javascript API.

     
      October 25, 2021 2:13 PM IST
    0
  • Can't you just modify the URL itself to include the parameter values as per your need?

    This and this may be of help.

      November 23, 2021 1:00 PM IST
    0