Upload a list as options to a multiple select question

Hi,

I have a list of villages in excel and I hope to upload it to an app and let it be the options of a multiple select question. Is it possible in CommCare?

Thanks!

Hi,

Yes, you can upload an excel sheet to create a lookup table and then set up a multiple choice question whose choices come from the table.

This page walks through the steps.

-Jenny

1 Like

And if your use of this information is more involved than this, you may find some utility in the Organizations feature. That lets you define the districts, villages, and other locations where your project operates, and use this information for reporting and case sharing.

Thank you for your answer! If I don't need a lookup table, ie. I don't have hierarchical data, just a question with 100 possible options. Is there a way to upload the list (since that's too much to manually enter) without using the lookup tables? We don't have the advanced plan right now :frowning:

I think that one way to solve this problem is to edit the XML of the form directly. The CommCare documentation has some instructions on how to do this (search for “Edit Source XML”).

After creating the multiple choice question with a few options in the Form Builder, you could select “Edit Source XML” and find where your question is defined. When doing this with an example question, I noticed there were two places where the option was mentioned. First as a value in a <translation> section:

		<text id="an_example_question-third_choice-label">
			<value>Third choice</value>
		</text>

and second as an item in a <select1> section:

	<item>
		<label ref="jr:itext('an_example_question-third_choice-label')" />
		<value>third_choice</value>
	</item>

Add your remaining options with the same XML tags and save your form.

You might want to practice this technique on a dummy form before editing your real one. And it’s probably a good idea to save the source XML before editing so you can restore it later if any problems occur.

1 Like

I think the easiest way to handle this would be by playing with the copy/paste data directly.

If you CTRL-C copy a question from the Form Builder you can paste it into a spreadsheet, modify the data in the spreadsheet, then copy and paste it back into the form builder.

-Clayton

2 Likes