Product Filters in Wized

I’m working on a product filtering system where users can select multiple price range checkboxes (e.g., “Under 300”, “300-600”, “10k-20k”), and I need to filter products using OR logic - meaning products should match ANY of the selected ranges.

I’ve set up:

  • Input fields for each checkbox (e.g., i.price_under_300, i['price_300-600'])

  • A “Get list” request with Filter type set to “Or”

  • Multiple filter conditions on the selling_price column

The issue: I need each filter to only apply when its corresponding checkbox is checked. When I try to use conditional values like i.price_under_300 ? 300 : null or i.price_under_300 ? 300 : undefined, I get errors like “Invalid input syntax for type numeric: ‘null’” or “Invalid input syntax for type numeric: ‘undefined’”.

I’ve also tried using the “Do not match filter” checkbox with !i.price_under_300, but this gives me “Invalid input syntax for type numeric: ‘true’”.

My question: What’s the correct way to implement conditional OR filters in Wized where each filter condition is only applied when a corresponding input field is true, and completely skipped otherwise?

Is there a way to make an entire filter row conditional, or do I need to use a different approach like Supabase Edge Functions?

Hi @mona.lgtpl

The invalid syntax error is due to the way a checkbox’s value is expressed.

By default if no value is set on the checkbox will either hold a true, false or null value. This translates to the supabase backend sending the true or false is equivalent to an SQL clause having the WHERE part as WHERE selling_price < true and this doesn’t work in the context of that column - which I think needs a number.

To get this working you need to do construct a supabase edge function since wized doesn’t support conditional filters. In the edge function you can do a POST of all the checkboxes selected and construct the appropriate query to get the right data.

1 Like

Ok, thank you for the help!