Select multiple values by default

Hi,
I have a multi-select field and i want 2 choices ie, say 2 and 3 to be selected by default. How is it possible. Also attaching an xls form for reference.

Dear @khasaab,
it’s easy. You can use default or calculation.
select_multiple items are stored in a space-separated string.
Like in general, default will not be an option for dynamic values.
I add an examples for both options here:
Preset Multiple_Select.xlsx (12.2 KB)
Kind regards

1 Like

Hi,
Thanks it worked actually the name of the choices in my list was number so it was throwing an error with the same code i used earlier, when Alpha was used in the name it worked fine for the default but for calculation part it worked for both.

2 Likes

Hi,
Just adding to your reply with the same example file you shared. How can we put a conditional default like for eg: if there is a Select one question with Choices 1 and 2 above Multiple Select Question and we have to display 2 fields by default if Select one is selected as 1 only other wise no choices will be selected if 2 is selected in the Select one question.

@khasaab just wanted to add the same approach which @wroos had pointed out, which you say did not work for a numerical name. I wanted to get back to this topic as it could benefit our community.

In the survey tab of your xlsform:

Image 1

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo:

Reference xlsform:

Preset Multiple_Select.xlsx (12.2 KB)

1 Like

Hi, Is it possible? like two same multiple question list, i want to when i select some of choice from first list , at the time deselect in second list which already select in first multiple question.

Welcome to the community, @shahi! Could you explain this in detail, please (some sample dummy questions and choices should also be helpful to understand)? Maybe the community should also be able to help you out if possible through KoboToolbox.

Thank You for your response! I have solved that issue which I mentioned, but i have more one query that’s " how to select all in multiple list?". thank You!

@shahi, you will need to put all the values under the default column as outlined here: