1 Reply Latest reply on May 9, 2016 7:20 AM by Rachel Cheuk

    Syncing Quick Filters & Javascript API Filter Changes

    Rachel Cheuk

      I'm using AngularJS to display a dashboard, and using Javascript to generate a way to save and load the filters the user selects.

       

      The dashboard allows the user to use a quick filter to filter values. I also have a separate filter selection created with javascript. I'm finding that interacting with both the quick filters and loading the filters via javascript is causing issues with syncing. JS does not always update the quick filter with the filtered values.

       

      The typical workflow is as follows:

       

      1. Tableau Dashboard Loads
      2. User changes Quick Filter selection
      3. Tableau Dashboard Updates appropriately
      4. User changes filter selection via Javascript.
      5. User loads these filter selections via Javascript.
        1. JS retrieves worksheet, and gets all sheets, then applies the filter to each sheet.
      6. Tableau Dashboard updates appropriately.
      7. Tableau dashboard "breaks". It cannot be changed anymore after this interaction.
        1. If user changes any quick filter selections, the dashboard "loads", but nothing changes.
        2. If user changes any js filters and loads, it doesn't load the expected filters.

       

      I'm not sure what's causing this issues, as I'm having trouble figuring out how best to debug this code.

       

      Any suggestions/insights would be appreciated.

        • 1. Re: Syncing Quick Filters & Javascript API Filter Changes
          Rachel Cheuk

          This may be resolved by first clearing the filters before applying a new filter set.

           

          Though I'm noticing a difference in the 'field name' value that is used. For Clearing filters, it seems the field used is the user friendly name that shows up in the Layout window.

           

          For applying filters, the field name that is used is the field name that appears in the 'edit filter...' dialog. This was a bit confusing at first.

           

          I'll update this post if needed.

          1 of 1 people found this helpful