Filtering for referenced fields in tables

Hi, can referenced fields like newfieldname: table (nameofthefield) be referenced as text to be used in filters for condition such as “contain”. It seems that the referenced field is returned as an object even when is a text and the only options are ‘Is exactly’, ‘Is Empty’ and ‘Is not Empty’.

Any thought?

Thank you

Hi @sleeusis :wave:

You should be able to yes. Here’s what a filter at collection level could look like for example:

You have the same filters at page level:

Can you share a bit more information about your project?

Maybe a couple of screenshots to help us see what the data you’re trying to filter looks like and where you’re trying to filter it (at collection level, on a page, using the filter dropdown or a filterByKey formula for example)

Hi @Joyce - I’m using supabase and for the collection I have a table called events with a reference field to a record in a table called sites. As on the screenshot below, I have a Site_Address:Site (Address) and I want to be able to filter for a condition containing a substring of the address but it seems the referenced values from the fields are returned as objects {} and the option is not there in the filter.



Thank you

1 Like

Ah ok got it!

So yeah, when you use the Advanced mode, Supabase returns an object which we indeed cannot filter on in depth at the moment. It’s a limitation of the plugin we’re aware of but not quite sure how to improve yet.

For now you have 2 solutions:

  1. create a view in Supabase where the address is a field, then fetch that view in WeWeb, and filter on that collection, or

  2. create 2 collections in WeWeb: one for your events table and one for your site table. Then, you can filter your events collection based on the id of the address in the site collection. Here’s a short video on how you would do this.

Does that help?

@Joyce - Yeah, I created a view in supabase before to circumvent this but I lost the realtime capability. I will try with your second suggestion. As always, thank you!

1 Like