2 Replies Latest reply on Jun 21, 2017 9:22 PM by Abhick Biswas

    Tableau JS API getfiltersAsync

    Abhick Biswas

      Hi,

       

      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.

                console.log(subjectid);

              });

        

       

      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"] = "";

                subjctidlist.push(subjectIdMap);

                subjectIdMap = {};

              }

          }

          return subjctidlist;

        }