I have a main collection list for which I have a lot of conditional filtering against. I’m having several problems using the ‘filter’ function for a collection list.
I’ve written it out in pseudo-code to keep myself organized. My intended filters:
Where if( length (selectFilter) > 1) apply:
collection id IS IN selectFilter
Note: could also ‘ignore if empty’ instead of length>1
And if ( viewFavorited) apply:
blockID IS IN favoritedBlocks
And if ( length(utilitySelect)>1 apply:
rollup (Utility_id, ‘id’) IS IN utilitySelect
Note: could also ignore if empty instead of length>1
And if ( filterOfficial = ‘official’) apply:
finalDispo ≠ null
OR finalDispo = ‘Approve - Creator’
OR finalDispo = ‘Approve - Community’
And if ( filterOfficial = ‘communityOffered’) apply:
finalDispo = ‘Endorse - Creator’
Currently I have the following problems:
The AND condition group is always applying even when the conditional as to when to apply it is returning false. So I am unable to test the filters after adding a second condition group.
The same goes for if I have the ‘Ignore if empty’ toggled on. An empty array, or an empty object does not prevent the condition from applying.
In #3, my fields is an array of objects. I want to filter based on the ‘id’ of the object and if it’s in an array of integers. I am not able to rollup or flatten the field I want to filter by. I am a little stuck on how to filter by the contents of this column.
I have tested most of the filters individually, but I cannot get them to work together in AND. OR works fine.
Thank you!
I am still having problems with this issue though. I’m a bit stuck as to how to only use the rollup of the id of the objects in this array, if I still need to have the add-ons of the entire object from xano.
I did post this in xano forum as well. I’m trying to avoid creating a separate column of the same information. The column is originally just an array of integers [2, 3, 12]. But that array is a reference to another table, which is why I extend that array of integers to return the data from the referenced table and why it’s returned as an object instead.
I asked in the xano community if it’s possible to return the original array of integers and the object of data separately within the same API endpoint. No luck so far.
The other option I just thought of, is ‘hardcoding’ it in a sense into the original collection list data. Not as a filter. But I’m still running into a similar issue of rolling up the id.