7 Replies Latest reply on Feb 21, 2018 4:27 AM by Lohith kumar

    Tableau JS API getfiltersAsync

    Abhick Biswas



      I am using tableau's JS API's getFilterAsync functionality, to get the applied values for a particular filter,, say SubjectId. Now i am seeing that, if the no of applied items are less than 5000 , I get all the items in the callback function, but as soon as it crosses 5000 i get only 200 items. Is there any limitation to the returned promise array??


      Below is my code.

        var patientData = sheets.getWorksheets()[3].getFiltersAsync().then(

              function(f) {

                    //if the no of items in the filter is  < 5000, all items are coming back, else i get only 200.

                   // Use the filter objects to get the filter details.

                subjectId = getSubjectIDs(f); //here i am extracting the subjectids.





      var getSubjectIDs = function(filterdata) {

          var subjctidlist = [];

          var subjectIdMap = {};

          for (var filter in filterdata) {

            if (filterdata[filter].$type == "categorical" && filterdata[filter].$caption =="subjectId")

              for (var value in filterdata[filter].$appliedValues) {

                //subjectIdMap["subject_id"] = parseInt(filterdata[filter].$appliedValues[value].formattedValue);

                subjectIdMap["subjectId"] = filterdata[filter].$appliedValues[value].formattedValue;

                subjectIdMap["indexDate"] = "";


                subjectIdMap = {};



          return subjctidlist;