table.setFilterStack({.....success:?

Hi! I need to trigger a query once my setFilterStack function is done, any ideas?
The trigger works with table.getDisplayedData(), hence the reason why I need to trigger it after the filter is done.
I'm calling the setFilterStack via JS code.

Thanks in advance

Hey @Ignacio_Martinez would await query1.trigger() work for you?.

thanks for answering. Nope, the trigger still runs before the table shows the filtered data.
this is my code:

table1.setFilterStack({
filters: [
{ columnId: "col1", operator: "includes", value: 'foo' },
],
});

await query1.trigger();

Hello @Ignacio_Martinez!

My first guess would be to add a debounce to the JS query block where you are running the filter.

The other common option for ensuring chronological order of events is using the on success Event Handler so that query1 will only be called once the code in the first query where the sorting is taking place finishes.

I hope that helps! Let me know if it works :crossed_fingers: