2 Replies Latest reply on Feb 10, 2017 6:35 PM by jiaying.huang

    Javascript API filter code to dashboard


      I am reading the Java script API to pass the filter from worksheet and I am trying to apply on the dashboard which the sheet function below dos work on the sheet but does not work when the object is dashboard.

      Can anybody help to advise me how to make the filter work on the dashboard.

      Attached is the javascript code in html , which can be open by notepad



      Bleow is the function only apply to worksheet but does not work on dashboard.. please help to see how can I get the function for the dashboard and it will be better if you know any dictionary for the tableau filter dashboard .

      function yearFilter(year) {

                  var sheet = viz.getWorkbook().getActiveSheet();

                  if (year === "") {

                      sheet.clearFilterAsync("Academic Year");

                  } else {

                      sheet.applyFilterAsync("Academic Year", year, tableau.FilterUpdateType.REPLACE);