Click Text Cell Change Color Using Custom State

Ok got it, :slight_smile: In your app, I created a new page called “example2” so you can compare.

Preview:
https://testsandstuff.bubbleapps.io/version-test/example2

Editor:
https://bubble.io/page?type=page&name=index&id=testsandstuff&tab=tabs-1

Custom states can either be a list of values or a single value. You have the custom state correctly set up as a single value (since you only want the User to select one Animal). In situations where one Animal is clicked, and the User changes their mind to select a different animal, the value of the custom state is ‘set’ only to the new animal (without needing to make the other selections not-clickable).

In your example, there are also two different custom states set on the text inside of the two repeating groups with the same name “Selected” (type: Animal, list: no):

Snake Text custom state:

Bird Text custom state:

Since you have two repeating groups (one for snakes and one for birds), you can’t access the “Current cell’s snake text element” custom state when “Current cell’s bird text element” is clicked, and vice versa. For example:

When Current cell’s snake text is clicked, the “Selected” state on ‘Text Current cell’s Snake’ is set:

But we can’t select Text Current cell’s snake as the element in the Bird workflow, so it was using a different custom state for the bird text.

Alternatively, I created a new custom state called “SelectedAnimal” on the page (called Example2 here). This can be accessed by any element.

Then the ‘set state’ in the workflows becomes:

When ‘clear’ is clicked, the workflow just sets the state back to ‘empty’:

And the conditional formatting for each RG cell text becomes:

And that should do it! If any of this was confusing or if you have any questions please let me know. :slight_smile:

3 Likes