2 Replies Latest reply on Nov 25, 2016 1:13 AM by painter PAINTER

    In javascript api - option to set the items available in filter

    painter PAINTER

      In javascript api - do we have an option to set the items available in filter?

       

      Eg: I have a filter 'Month' and by default report shows months as 1,2,3....,11,12.

      Once report is loaded via javascript api, I need to show only 3,5,8 as available values in this filter.

       

      I know, there are options like creating a set and based on parameter provided from api, load corresponding data set.

       

      Without making any changes at report side (like creating set, parameter, etc), is there an option to do it via javascript api?

        • 1. Re: In javascript api - option to set the items available in filter
          Dan Huff

          This is definitely not my area of expertise so apologies in advance for me just thinking out loud. I see two ways to accomplish something like this. The first, and likely easiest, is the one you mention: alter the report in some way. This involves the least work.

           

          The other option I could see (and this is where I'm guessing more than anything) is to create a set of buttons on your page then end up making a call to applyFiltersAsync where you allow your users to select one or more of the buttons corresponding to 3,5,8. This would prevent you from changing the underlying report I suspect but would be a bit more work to design/implement.

           

          Dan

          • 2. Re: In javascript api - option to set the items available in filter
            painter PAINTER

            Thanks Dan.

            But the solution you suggested won't work with my requirements.

            As per your suggestion, users will select filter from my host page and will be triggering the selection in report page.

            As per requirements, -

                 1. we need the ability for user to select the filter directly from the filter options in report.

                 2. When host page loads, the filter in report should show only 3, 5, 8.

             

            I feel it is not implemented in the tableau API. Anyway thanks for your help and lets see any other idea is coming up.