2 Replies Latest reply on Nov 4, 2014 2:23 PM by Nay Lin Soe

    tableau 8.2.2 API Question Set filter on Dashboard level

    Peter Maslin

      Hi

       

      i have been going through the online documentation and i was wondering if there is a .setfilter command available on the dashboard level that applies to all elements within it , i know it can be done on the workbook level , but is there a top level version of it.

       

       

      Peter.

        • 1. Re: tableau 8.2.2 API Question Set filter on Dashboard level
          Patrick A Van Der Hyde

          Moved to Developer Community for a better chance at a response. 

          • 2. Re: tableau 8.2.2 API Question Set filter on Dashboard level
            Nay Lin Soe

            I assume you are talking about Javascript API. I was looking for it as well, and don't think there is one (or I don't know it). So I use this function to filter at dashboard level:

             

            function filter(fieldName, values)

            {

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

                if (sheet.getSheetType() == 'worksheet')

                {

                    sheet.applyFilterAsync(fieldName, values, tableauSoftware.FilterUpdateType.REPLACE);

                        //.otherwise(showErrorMsg);

                }

                else

                {

                    var worksheets = sheet.getWorksheets();

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

                    {

                        worksheets[i].applyFilterAsync(fieldName, values, tableauSoftware.FilterUpdateType.REPLACE);

                            //.otherwise(showErrorMsg);

                    }

                }

            }