How to SetList from Repeating Group of Checkboxes

I am working on a job listing page, where the poster selects from a list of skills that are required for the job and then saves the job posting. The list of skills is an option set, and then in the front end I have a repeating group that lists that option set and has a checkbox for each that can be checked if applicable.
I am trying to create the workflow to take only the skills with checkboxes from the RG list and SETLIST them to the database record for that job posting. I am unable to figure out how to invoke each RG cell’s checkbox value in the workflow, so the entire option set list keeps being saved to the database.

Does anyone know how to do this?

Create a custom state with type text and make it a list.

Now when a checkbox is ticked, add “Current cells skill” to the custom state list of texts. When save or submit is clicked, save this state’s value to the database in relevant field.

I feel like I have the same question, but I am unable to save the list of selected checkboxes to my custom state.

My list of checkboxes is a RG of an option set I’ve defined in the app (called “Qualification_set”).

I’ve tried making my custom state both a list of “text” and a list of “Qualification_set” as data type, neither seem to work.

Watched a bunch of tutorials on custom states, and not able to apply to my app logic. My aim is to have a user select which qualifications apply to their profile, save as a list of the checked boxes in a custom state, and when the user finally submits the form, the custom state list will be saved to the users data type.

Any additional guidance or pointers would be appreciated. I’m trying to figure out how to share my workspace, but cannot find that option.

Wow, your use case is EXACTLY the same as mine. I am still working on it, but I’ve figured out the part you are struggling with. You can’t call setList on a custom state list from a repeating group directly unfortunately, you have to achieve the same result by using :plusItem and :minusItem. In order to save the checkbox’d items from the repeating group to the custom state, you need to create a workflow with 2 steps for “when element is changed” and set it to the checkbox in the RG. One is for when checkbox is checked, and set the workflow step to be :plusItem to the repeating group. And then the second step is for when the checkbox changes to unchecked, and that triggers :minusItem to the repeating group. Then the save button just triggers a regular setList with the database as the target and the custom state as the source.

The piece I’m working on now is how to prepopulate the checkboxes from a database value when the screen is opened in “edit” mode vs create-new mode.

Thanks @bententious !

I finally got it working, just as you described. I found this YT video from another forum thread very useful.

Have not through through the process to pre-populate checkboxes, but I suspect the answer lies somewhere on on the Checkbox’s conditional tab.

I’m not sure when that video was recorded, but FYI Bubble does let you do a :minusItem to a custom state list now, so you don’t need to do that filter workaround anymore.

BTW I just figured out the prepopulation as well just now: I set a workflow to sync the page’s underlying database record’s skills list to the custom state skills list, then you can use the dynamic status within the checkbox object to sync the RG checkboxes to the custom state.

This topic was automatically closed after 70 days. New replies are no longer allowed.