budibase icon indicating copy to clipboard operation
budibase copied to clipboard

The is in filters don't work when using more than one filter of the same type.

Open ConorWebb96 opened this issue 1 year ago • 3 comments

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:

  1. Import the app export below
  2. Go to the home screen
  3. Click on the table block component
  4. Click on the filtering button.
  5. Change the behaviour to match any filter
  6. Add filters that match this structure id -> is in value [1,2,3].
  7. See that the above on its own works if added and saved
  8. Add an additional filter id -> is in value [5,6,7,8]
  9. 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 20240207_122522

App Export or filters-export-1707308859327.tar.gz

ConorWebb96 avatar Feb 07 '24 12:02 ConorWebb96

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.

updated-filters-export-1707316601414.tar.gz

ConorWebb96 avatar Feb 07 '24 14:02 ConorWebb96

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.

ConorWebb96 avatar Feb 08 '24 10:02 ConorWebb96