Completely new with Bubble here, sorry if this is basic.
I have a RG with books in them. Each book has different levels of categories that they can be filtered with. The filters (categories) are in the form of tags and multiple tags can be selected. And there are two levels of tags - Level 1 and Level 2. The moment a tag is clicked, I have a custom state that adds the category value to the custom state ‘selectedL1’ or ‘selectedL2’ depending on which level of category was selected.
I have then filtered the RG data source such that only those books are shown whose list of categories/tags intersect with the tags in the custom state for each level.
The problem here is that if none of the tags of Level2 are selected, then I just want filtration to be done on Level1 tags. So if the custom state does not contain any tag for a given level, then filtration should not happen for that level. Filtration should happen only when a tag is selected.
Example: If i have selected ‘Antifiction’ in L1 and none in L2, I want all books tagged to L1 be shown. If I have selected ‘Antifiction’ in L1 and ‘History’ in L2, I want the list to be filtered for both. But right now if i do not select anything from Level 2 i do not see any books since the custom state for L2 ‘selectedL2’ is empty and the filter does not return any value as both the filters are applied.
I need to add another level of category after this so I would really appreciate if someone could guide me here.
Here’s my read-only project link for you to understand better in case I wasn’t clear here: https://bubble.io/page?type=page&name=index&id=antilibrary&tab=tabs-1