Checkbox Preset Status checked if label is contained in a list field in DB

I have a form with a lot of checkboxes, i dont have a yes\no field for each checkbox in the DB, instead i have a single field which collect’s a list of the checkboxes label’s that was checked.

  1. How do you get the checked text lablels saved to a list field.

  2. When Editing an entry, how do you have the Preset Status of a Checkbox depend on whether the label is included in the list field in the DB?

1 Like

I would give each a field in the database, even if we were talking about 100 checkboxes. I don’t think your way is saving effort.

If it’s possible at all, it’s probably running a query if your field CONTAINS fieldname.

If i can figure the Expression Recipe, i would save a LOT of effort, instead of creating 50 new fields and naming it, i can create a single field, build the expression, and copy it to all checkboxes

I second doing the fields instead.

With your list method, your checkbox workflows will still involve typing in the label for every single one. E.g. “When this checkbox is checked > add [label name] to list”. You would have to do this because the checkbox doesn’t hold a text string value, just a yes/no. So one way or another, typing in each value will need to happen.

If you create a separate field, you can take advantage of auto-binding to cut down on workflows and you won’t risk potential label changes from disconnecting the list values.

Got it, thanks for taking the time to help out.

I figured out a way to do this. It’s inspired by this awesome tutorial: https://www.youtube.com/watch?v=yahP3RyVggY&feature=youtu.be

If you create a new data type for your checkbox items (let’s call it ‘checkbox items’), then you can call up a repeating group of all entries as is done with ‘users’ in the referenced tutorial. (You would only need to enter each checklist item once until you have your full list of records/questions in your checkbox data type.) Note that the field to which you save this list of checkbox responses must have its data type be ‘checkbox items’.

Then, the two extra steps would be:

  1. add a save button with a workflow to “make changes” to wherever you are saving the checkbox responses to “set list” to the value of all selected items (i.e. the selected repeating group)
  2. if these checkbox responses can be edited, then on the edit page, be sure to set the custom state of the repeating group on page load based on the saved list of originally selected items, and do the same for the check boxes with a conditional statement to dynamically check the boxes in the repeating group