hi,
I have a number of buttons that represent toggles or selections users can make, in the same way, tickboxes work. For example, I’d ask users to select a number of options that apply to them.
I would like every “selected” button to change colour (which I have already created through conditions on the Design tab), while users would be able to “unselect” options by clicking on the button, which would revert back to its original colour. In preview, when i select the button, it changes colour, but when i select it again, it remains selected. I’m not sure what to do. please help!
I saw an example from 2021. This is exactly what I want it to do, but based on this example I do not see “[custom state] parameter” option in the workflow pop up (under the Elements drop-down). What am I missing?
Here is the 2021 example - what I’m trying to achieve:
-
Test805421 | Bubble Editor
-
https://test805421.bubbleapps.io/version-test/category_list_parameters?categorylist=Hikes,%20Concerts,%20Beaches,%20Experiences&debug_mode=true
-
I don’t see this option. My custom state name is Selected Feelings. Shouldn’t i see ‘Selected Feelings Parameters’ here, as shown in this example??
If you are adding something to a list of other values via the custom state, you will need to when adding a new value use the expression ‘custom state value :plus item this buttton item’ and when removing with the same button have the condition ‘custom state value : minus item this button item’
Thanks. I’ve used the expression as described and it doesn’t work. Actually, in preview the buttons no longer become blue when clicked. Note: I have an option set with a list. so, the expression in workflow that I have been using are as follows:
Step 0: Element - “Button Current cell’s (option list) is clicked”
Step 1: Value - “custom state value: minus item Current cell’s (option set list)”
Step 1: Only When - “custom state contains Current cell’s (option set list)”
Step 2: Value - “custom state value*: plus item* Current cell’s (option set list)”
Step 2: Only when - “custom state doesn’t contain Current cell’s (option set list)”
In preview, using the above expressions, buttons can be selected, but not deselected. I have tried reordering the steps in the above workflow but then I cannot select the buttons at all. Note: I have done a number of tests and it seems to come back to that Bubble isn’t recognizing the above expression to deselect.
Don’t put conditions on steps, put them on trigger. You need two triggers each with own condition for when the button is clicked
Omg! Thank you, I have been trying to figure this out for a few days now. Thank YOU!
1 Like