
HI All,
I am trying to get values set for a filter using 'getAppliedValues', as per the documentation it states that "If more than 5000 values are selected, only the first 200 are returned."
I want to display an error message to the user if values selected for the filter are more than 5000
something like getAppliedValues().count > 5000, show error.
but in this case the count is 200 and hence it fails.
Is there a property in the filter i can use which specifies data has been truncated so i can appropriately display user the error message.
Any help to fix this would be really helpfull.
@Keshia Rose (Inactive) tagging for help.
Unfortunately there is no property in the API to let you know if getAppliedValues() is being truncated. I've logged a ticket internally (1160451) but for now you may be able to use getSummaryDataAsync() instead to get the filtered values:
let data = await sheet.getSummaryDataAsync();
let column = data.getColumns().find((c) => c.getFieldName() === 'Your Filter');
let index = column.getIndex();
let values = data.getData().map((mark) => mark[index].value);
values = [...new Set(values)];
console.log(values);
-Keshia