1 Reply Latest reply on Mar 23, 2016 2:10 PM by Brian Coggon

    Issue with filter and actions using the API

    Jason Hutton

      I am rendering a view on a web page and passing a filter from a cookie so that the campus will be selected for each user.

       

      var options = {

              hideTabs: true,

              hideToolbar: true,

              width: tbWidth + "px",

              height: tbHeight + "px",

              onFirstInteractive: function () {

                  var workbook = viz.getWorkbook();

                  var activeSheet = workbook.activateSheetAsync(tbMainDashboardName).then(function (dashboard) {

                      var worksheets = dashboard.getWorksheets();

                      for (var i = 0; i < worksheets.length; i++) {

                          console.log(worksheets[i].getName());

                          worksheets[i].clearSelectedMarksAsync();

                      }

                  });

              }

          };

          for (var n = 0; n < tbCookieFilterNames.length; n++) {

              var _name = tbCookieFilterNames[n],

                  _cookieName = _name.replace(/\s+/g, '');

              if (readCookie(_cookieName))

                  options[_cookieName] = readCookie(_cookieName);

          }

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

       

      When I do this, it shows all of the values for a Filter Action as if I had selected "Show all values" for "Clearing the selection will:" in the Edit Filter Action dialog. The published file has "Exclude all values" selected for that option.

      Also note, if I do not pass a "default" filter into the options, I get the correct behavior.

       

      Thoughts? Is this a bug?

       

      Thanks

      Jason