I’m looking for a more efficient way to handle scenarios like repeating groups built as multi-select dropdowns.
I am sure there must be some obvious hack I’m missing, but I haven’t found it yet.
Scenario:
- Store selected options in a repeating group or state variable
- When user clicks a cell, need to toggle that option (add if not present, remove if present)
My current implementation (3 actions):
- ‘Is Selected’ custom event checks if option exists in list and returns data
- If not in list: Display list with :plus item
- If in list: Display list with :minus item
Is there a way to accomplish this toggle functionality in a single expression instead of three separate actions? If not, what do you think is the best way to do it?
hergin
2
Interesting question. I was always doing it as you explained as well. But I decided take this as a small challenge. I knew it was possible with the limited number of list operators Bubble has but I didn’t know how. I could finally find it after some half-hour effort
It doesn’t look bad but efficiency should be checked I guess.
Here is how it is running in a single expression:

Here is the expression:
And here is how I came up with it with some test cases 
And here is the editor if you want to play with it: Tests for Forum 14 | Bubble Editor
1 Like
system
Closed
4
This topic was automatically closed after 70 days. New replies are no longer allowed.