Hi Peter,
First off, I’m not 100% sure if this is a plugin issue or a bubble issue so bare with me.
I have a table for storing custom filters, as these can vary depending on what page the user is on I have tried to make as universal as possible depending on what entity the user is trying to filter. To do this I use a jsonb column, example:
{
"status": {
"value": 5,
"operator": "eq"
},
"name": {
"value": "%something%",
"operator": "ilike"
},
"approved": {
"value": true,
"operator": "is"
},
...
}
I have an apiconnector set up for a single entity for testing right now, I have manually created each filter to be identical in structure so they contain all of the options, and then varied the contents of the filter values.
I then pass the apiconnector “thing” into a custom plugin which rips it apart and converts it into a query that the any filter of this plugin can accept.
All of this works absolutely fine for strings and integers. In the example json above, my code returns
.eq('status', 5).ilike('name', '%something%')
You’ll notice the result is missing the “approved” value, my code ignores empty/null values deliberately so as not to break the filter.
Therein lies the problem. Approved isn’t empty. It should be true. But when I use debug mode, the supabase element for the filters table is showing the result for approved is (empty)
for every row, but the raw json body shows correctly (approved : true). I have set the apiconnector up to be a yes/no, I have also tried yes/no (+ blank option). Neither work. All of the boolean values in my filter json, every row, they are empty.
IS there something I’m doing wrong, or is there an underlying issue with how bubble interprets this?