Hi everyone!
I’m working with a Supabase backend that has a hierarchy of information with several levels, each with a foreign key reference to the level above it. I have RLS policies in place to restrict user access based on the uppermost level, so that handles security. The rest is more about convenience/UX.
To that end, in WeWeb I am trying to filter my collections to narrow down the data that’s loaded. Filtering table 2 items based on a value pulled from table 1 is trivial as table 2 has a “parent item from table 1” property. Things get trickier for levels below that, though. Say I want to filter table 3 items based on their relationship to table 1 via table 2 - how do I do that in WeWeb? i.e. if I only want to show items from table 3 that are related to items from table 2 that are themselves related to the value pulled from table 1? And what about the next level under that (table 4)?
Table 1
Table 2
Table 3
Table 4
It feels like in the filtering menu for the table 3 collection I should be able to specify “parent table 2 item” IS IN “table 2” collection, but that’s not an option here:
It seems if I try to fetch more than one property from a foreign key relation (in this case I am fetching the “parent table 2 item” UUID and name), the filtering element treats the foreign key as an array with no option to specify just one property from that array, and restricts the filtering operator options accordingly. Is that a bug, or am I doing this wrong?
Any help would be appreciated