1 Reply Latest reply on Jul 22, 2015 9:26 AM by diego.medrano

    Javascript API setting action filters on dashboard

    Carlos Jourdan

      Hi,

       

      I just started playing arround with the javascript API, and I'm running into a couple of problems when interacting with action filters on a dashboard. My dashboard (MyDash) has two sheets (Sheet1 and Sheet2), and I've defined a filter action that activates when selecting the first sheet that filters the second. This action works on only one field, and the set associated with is named ActionFilterSet.

       

      My first experiment was to try and clear the action filter. So I used code that looks something like:

       

      myDashboard.getWorksheets().get('Sheet1').clearFilterAsync('ActionFilterSet');

       

      In this line myDashboard represents a variable that points to the dashboard sheet. This code clears the filter for Sheet1, but Sheet2 stays as it was, generating an incosistent state. Is this a bug, or is it the expected behavior? Is there any way to have the same behavior as a user would have when setting the filter to (all)?

       

      The second problem I run into was when trying to set the filter to a specific value. Here's my code:

       

      myDashboard.getWorksheets().get('Sheet1').applyFilterAsync(

        'ActionFilterSet',

        'SomeValue',

        tableau.FilterUpdateType.REPLACE);

       

      If I run this code I get an exception of type invalidFilterFieldName. Any thoughts on why this is happening? IsapplyFilterAsync not valid for sets/action filters?

       

      Regards

      Carlos Jourdan