Hello,
Here’s a newbie question: I’m trying to figure out how to filter the type of events in a calendar based on multiple criteria.
I have a thing called Events that I use as data source in the calendar.
Each Event has a “Type” field which I want to use to select relevant Events to display. Right now, this field has 4 possible entries – type1, type2, type3, type4.
My first instinct was to create checkboxes above the calendar for each Type. I found several ways to change the data in the calendar based on which checkbox is checked. But now I’m stuck on how to proceed when more than one box is checked.
The user must be able to check 1, 2, 3 or 4 boxes at will.
If all boxes are checked, I want to see all my Event entries. If only two boxes are checked, I want only the events with the two corresponding types.
I’m trying to tell the calendar something like:
- Check which of my 4 boxes are checked
- Then filter my Event list only with the corresponding checked types
It crossed my mind that I could set all 16 possible box combinations in the conditional tab of the calendar but, of course, it doesn’t seem very clever – especially if I want to add more types in the future.
I’ve tried in vain several complex expressions in the data source, the conditional tab – even looked for a workflow. But nothing worked: I can’t seem to grasp the right “bubble way” to do a sort of if/else condition. Something like: - Search for my Events
- If type1 isn’t checked, remove type1 events from the list, else ignore
- If type2 isn’t checked, remove type2 events from the list, else ignore
- If type3 isn’t checked, remove type3 events from the list, else ignore
- If type4 isn’t checked, remove type4 events from the list, else ignore
I don’t know where the problem lies: whether I suck at using expressions , or whether it’s the logic of my approach that’s wrong?
I tried with multiple contraints, successive “:filtered”, merging and intersecting… All my expressions where either wrong (red) or, in the end, loading no event or only one type of event in the calendar…
Could somebody hint toward a solution?
Thanks!