Bug Report: Clearing multiple table filters

Using latest version of cloud.

I have ran into an annoying issue with table filters that took me a little while to track down.

When setting multiple filters on tables programmatically, everything works well - however when removing multiple filters successively it only removes the first filter. For example, the following script will only clear the filter with ID test1:

table.clearFilter("test1");
table.clearFilter("test2");

The workaround to this is to put a delay on the second clear call, around 10ms seams to work.

table.clearFilter("test1");
setTimeout(() => {
    table.clearFilter("test2");
}, 15);

This is not intuitive and ideally would not be needed, or clearFilter() should be updated to allow clearing multiple filters, for example it would be nice if we could instead call:

table.clearFilters(["test1", "test2"]);

Not a huge deal, but just putting it here in case anyone else runs into this issue in the future hopefully I can save them some time and hopefully this can be worked on in future versions.

EDIT: I have also realized this same issue occurs with setting and clearing filters at the same time. For example, if I clear test1, and set test2, it has odd behavior. If I place a timeout on one of the calls things work as expected.

Hello @jamesg31

Thank you for finding this and discovering a short term solution via the timeout!

I agree, something like table.clearFilters(["test1", "test2"]); would be preferable. I will make a feature request to our eng team for this.

Very odd that clearing then setting also causes issues :melting_face: if timeouts are the solution that should be an easy enough short term work around until we can get those filter commands to execute smoothly!

1 Like