No variables shown for Back End filters - Supabase

Hello!

I’m currently dealing with a large dataset comprising 10,000 rows from the Supabase DB. Clearly, it’s not practical to filter all this information in front-end with filters. Therefore, I’m looking to implement backend filtering.

The idea is that users can select filters, and based on their choices, the system will fetch the relevant data from the Supabase DB. However, I’ve encountered an issue where no variables are being displayed when attempting to create backend filters. I’m unsure if this is a bug or if I might be overlooking something in the process. Can you provide any insights or guidance on this matter?

You might want to click on the arrows next to the close, that might expand some options. Maybe bind/unbind.

@Broberto Deam, you’re right. My bad.

When I try to bind it to my variable, it shows this error:
name: “Error”
code: “22P02”
details: “Token “X” is invalid.”
hint: null
message: “invalid input syntax for type json”

Everything works when I filter the exact way in front-end, instead of collection.

Could you show us the filters?

@Broberto
Tried it without variable, still doesnt work.


Variable: Multiselect has value of array.


This works completely fine, when I filter the collection in the front-end, but I can’t do that.

I have a feeling that the slash might be a problem. Could you try with somerhing without a slash (/) to actually confirm if this is the issue? I haven’t used these filters often honestly, so I’m just trying possible solutions.


Guess it’s not the problem. @Broberto

This feels like a bug… @Joyce maybe you have an input for this?

@david

This works for me actually. I assume that your database field ‘product’ is an array of texts? I have a field which is an array of texts and I’m using exactly the same method as you and it is working perfectly.
The error suggests this is a Supabase (PostgreSQL) error not WeWeb.

Supabase plugin filers items on back-end so double check your ‘products’ definition. The error suggests that PostgreSQL is receiving wrong datatype,

I even checked with 'X / Twitter" and it still works :slight_smile:


The collection is empty as I do not have “X / Twitter” item…

@david what type is the column that is getting you an array?

I also had an issue in the past using the same stack.
I was using a JSON col in supabase but I had trouble using the arrays operators in the collection configuration in WeWeb.

I changed from a JSON type to an TEXT type to represent a real array and it works fine now.
It might be a trick and maybe the front should be updated to better operate on JSON.

BUT : HOPE guys. The new version of the supabase SDK is being implemented and should soon be available to us.

1 Like

Yup, it helped to change to Text, instead of JSON in supabase side, but still having some problems.

“Ignore if empty” doesn’t work. @Matthieu did you also ran some problems with this? Building a directory with bunch of filters, that should fetch collections.

Fixed it by creating custom “ignore if empty” and fetched all the time something changes.