0 Replies Latest reply on Oct 16, 2018 9:01 AM by Martin Borugadda

    Multiple ApplyFilterAsync function calls are making network calls sequentially instead of simultaneous

    Martin Borugadda

      Hello All,

       

      I've a Tableau workbook with multiple worksheets. I need to apply a filter across these worksheets and so I'm iterating through the worksheets and calling the applyFilterAsync function on each one of them. I'm logging a message to the console each time this function is called and I could see that applyFilterAsync is called on all the worksheets very fast.

       

      Code:

      for (var ws of dashboard.getWorksheets()) {

           console.log('Applying filter.');

           ws.applyFilterAsync(field, value, tableau.FilterUpdateType.REPLACE);

      }

       

      Problem:

      The network calls to Tableau for this function are being made sequentially. The call related to next function call is being made only after the response related to the current one is received. The result is the time taken to apply the filters across the worksheets is very long. The entire dashboard freezes (with the progress icon spinning) while these filters are being applied.

      Filter_Network_Calls.png

       

      Questions:

      1.     How can we make these calls concurrent? Is there anyway we can reduce the execution time for this logic and make the dashboard appear faster?

      2.     Can we make the progress spinner disappear as the filters are being applied on each worksheet? Can we show each worksheet as soon as the filter is applied, instead of waiting for the other worksheets?

       

      Thanks in advance,