How to use Checkbox Lookup table

I am getting below error

Select answer options cannot contain spaces. Question org.javarosa.form.api.FormEntryPrompt@10400b6e with answer Spousal conflict.

spousal conflict is my data option to select.

Can anyone help me to understand why I am getting the above error?

By default select question items can't contain space characters since multi-choice selections are separated by spaces.

The easiest option is to swap the space character for the item value to an underscore, ie: "spousal_conflict"

Perfect!!!! That's the solution .. Thank you so much

Hi [Clayton_Sims],

While running the app, it is showing answers with the underscore format only. can we get rid of underscore?

Select questions should have a Label and a Value. The label is what is shown to the user, and the value is what is stored into the dataset. You can use the space separated / non-underscore format in the Label.

Hi Clayton,

Not getting it. Could you please explain in detail. plzz?

I am using Checkbox look up table. I am not use where to have lable and value in it?


The look-up table that is being accessed by the multi-select checkbox question must have columns for a value and label. For each option in a multi-select or single-select question, the value is what is actually saved when answering, while the label is what is actually displayed to the user. The value cannot have spaces or certain special characters, while the label can have anything.

For example if you have list of symptoms:
value = runny_nose, label = Runny Nose
value = sore_throat, label = Sore Throat
value = headache, label = Headache

If you want to retrieve the actual label that was selected from a multiple-select or single-select question, you'll need to query the lookup table using a "Hidden Value" question type and retrieve the label display text for the given value. Here's a CommCare resource that should provide some guidance on how to do this: