Is my approach to saving checkboxes wrong? It's so hard!

I regularly want to have forms with multiple checkboxes where users can optionally check as many items as they want, and I want to save all checked items in a database item as a list.

All the solutions to do this that I’ve seen on this forum are incredibly cumbersome!! Am I doing something wrong? It seems like it should be easy to save checkbox values in the database!

Without seeing what you’re doing, can’t tell if it’s wrong or not.

Generally with Bubble, what may seem hard or unfamiliar at first becomes easy and fast with time.

Generally with Bubble, what may seem hard or unfamiliar at first becomes easy and fast with time.

Yes! That’s what I’m hoping for. This is one thing that I’ve run into over and over though, and it never seems to get any easier so I must be doing something wrong.

Here’s some screenshots:
First: a whole bunch of checkboxes with different values for various roles. I want to save all of these into the role field as a list of texts. I want to be able to add/remove these from therole field using add and remove

When I try to add them, it just gets complicated. There’s only one that can be added at a time, or if I use add list then it’s adding/removing yes or no over and over and I would have to go in and modify each one. Also I have to pick each one manually instead of adding the whole group automatically.

To create a simplified case: Imagine a data type called “User” which has the field “favorite_colors”. I want them to be able to check ALL of their favorite colors:

What are your favorite colors? Check all that apply.
:ballot_box_with_check: red
:ballot_box_with_check: green
:ballot_box_with_check: blue
:ballot_box_with_check: orange

And whatever they check goes into the “favorite_colors” field which is a list of text:

favorite_colors: “red, blue, orange”

If the option type is text, you should be able to store the text list in a single field.

Based on the last example, you should be able to ‘set’ a list of selected favorite colors from a state.

I’m not following. My goal was for it to be a single field (a list of texts). Is that what you meant?

Confused by what you mean by 'set’ting a list from a state.

You can first create a list of text in a state and then save the value to this state in database.

Since this is a list, you will set the state’s value to your favorite colors field in database.

If this still doesn’t make any sense to you, may be I am not explaining it well. I can create a demo for you in the morning.