budibase
budibase copied to clipboard
The is in filters don't work when using more than one filter of the same type.
Checklist
- [x] I have searched budibase discussions and github issues to check if my issue already exists
Hosting
- Self
- Method: docker compose
- Budibase Version: 2.17.6
- App Version: 2.17.6
Describe the bug When trying to filter by multiple is in types regardless of whether they should return values. No results are returned.
Additional issue not sure if its related but when going through the steps, the first matched row isn't returned as part of the filtered results. Not sure if this is related but it might be.
To Reproduce Steps to reproduce the behavior:
- Import the app export below
- Go to the home screen
- Click on the table block component
- Click on the filtering button.
- Change the behaviour to
match any filter
- Add filters that match this structure
id
->is in
value
[1,2,3]
. - See that the above on its own works if added and saved
- Add an additional filter
id
->is in
value
[5,6,7,8]
- See that now no results are returned.
Expected behavior It should return results that match both is in filters, if you were to combine the filters into one it would return all the results minus the first one for whatever reason. Similar behaviour should occur whenever you use more than one is in filter.
Screenshots
App Export or filters-export-1707308859327.tar.gz
This issue happens with multiple is in filters as well as any additional filters that have is in included in them.
You can replicate this behavouiur with the following data sources;
- External data sources e.g. postgres, mysql and rest sources.
Internal table doesn't have this issue. Heres the most updated version of the app including a working internal table with similar filters.
There is a workaround for multiple is in filters and that would be to concat all your filters into 1.
Example JS below
const array1 = $("table1.Rows")?.map(row => row._id);
const array2 = $("table2.Rows")?.map(row => row._id);
const array3 = $("table3.Rows")?.map(row => row._id);
const concatarray = array1.concat(array2, array3);
return concatarray;
However, the overlying issue still remains. You can't add any additional filters to external data sources. Whether they be simple equal checks against strings etc.