Event handler: Filter - automatically adds ID filter - why?

Hello,

I am using a switch to control a filter on a table.
It's not a very busy table. Will almost always have 40 or less rows.

I am using a Switch, with True /False. And on the True event trigger, I have the following:

However - what I am finding is, when I flick the switch to = True
It adds the filter I want but... also is adding an ID filter - which I don't want....

I see it in the filterstack, but I don't recognise the ID or where it has come from... or why....

Is there any way to avoid this?
thanks!

Quick video/gif below to show what is happening and what it should be:

retool1 (1)

Hi @maillme, do you have a component called "dd757"? Based on your filterstack, that's an ID I would be investigating as well. Not sure if this affects it but your True event handler's screenshot has Filter ID 1 while the gif contains swtchPrimaryTopics.

Hi Jocen,

thanks for taking the time to reply.

Yes, i did notice dd757 - I done a false event handler so I could search for it, doesn't come up anywhere:

Could it be, that this is the ID of the filter button on my table - when you add it via the table component?

One thing I notice is, that when I load this table (the container that it is placed) the ID = "" filter is already applied by default - so I think that is perhaps the source of the problem. Why or how this is applied - I have no idea :frowning:

On the other point about ID's - yes, I was experimenting with lots here, to see how it affects things. It doesn't seem to make any difference what I place here. It's also not so clear to me what this field is for? I was thinking it is a way to ID which filter in the overall filterstack it is - but perhaps not.....

thanks again, Neil

Hi @maillme,

Ahh, I see. I got curious and tested on my instance. I noticed that if the events you have there (true / false) does not have the same ID, they won't behave as what you'd like them to be.

Keeping one event (false) to having {{self.id}} and the other (true) with a "" id, the filter just kept on adding the filter that I indicated in the true event.

Have you tried aligning the ids for your events and see if that result to what behaviour you are expecting? Probably set it to {{self.id}}?

Cheers!

1 Like

@jocen,

It was a typo!! :man_facepalming:t3:

See below:

the ID = 0 filter still appears, by default - but it doesn't affect anything.....

I don't have option to provide an ID in the false, necessarily - because I am using the clearFilterStack method on the table.... so it's only the table that I need to ID.

retool

3 Likes

@maillme, :joy: love these moments. even the best of us has fallen to such scenarios.
Glad that was resolved!

2 Likes