It sounds like you're diving into a very useful feature of KoBoToolbox and XLSForm! Using external data for choice lists is indeed the way to go when you have a large number of options, as it keeps your main form lighter and easier to manage.
Here's a breakdown of how it generally works in KoBoToolbox using XLSForm and the methods you mentioned:
What is External Data for Choices?
Normally, in XLSForm, you define your multiple-choice options directly in the "choices" sheet of your Excel file. However, for lists with hundreds or thousands of options (like a list of all villages in a region, or a catalog of products), putting them all in the "choices" sheet can make your form very slow to load and navigate.
External data allows you to store these large lists in a separate file (like a CSV) and link your form questions to this external file[1][2][3]. This keeps your main XLSForm clean and improves performance.
Methods for Using External Data[1]
KoBoToolbox primarily supports using CSV files for external choice lists. While connecting via a live URL for choices isn't a standard built-in feature for dynamic choice lists directly within the form's questions in the same way as CSV files, the KoBoToolbox API allows you to interact with your data via URLs for other purposes like data export and integration with other platforms [2, 5, 6]. For providing large choice lists within the form for data collection, the CSV method is the primary approach [1, 2, 3, 4].
Using a CSV File for External Choices[1][5][6]
This is the most common and well-supported method for handling large choice lists in KoBoToolbox via XLSForm [1, 2, 3, 4].
Here are the general steps involved:
-
Prepare your External Data (CSV File):
- Create a simple database in a spreadsheet program (like Excel or Google Sheets) containing your list of choices [1].
- This file should have at least two columns:
name and label [2, 4][1][2][7].
- The
name column contains the unique value that will be stored in your data when a choice is selected.
- The
label column contains the text that will be displayed to the user in the form [2, 10].
- Ensure each row has a unique identifier [1].
- Save this file as a Comma Separated Value (CSV) file [1, 2][5][8]. It's crucial to save it as CSV UTF-8 to avoid issues with special characters [1]. Be mindful of your spreadsheet software's settings, as some (like Excel in certain language configurations) might use semicolons instead of commas as separators, which is not compatible with KoBoToolbox [1]. You might need to adjust settings or use an alternative like LibreOffice Calc [1].
-
Prepare your XLSForm:
- In your XLSForm (the Excel file you use to build your form), go to the
survey sheet.
- For the question where you want to use the external choice list, set the
type column to select_one_from_file [filename.csv] or select_multiple_from_file [filename.csv], replacing [filename.csv] with the exact name of your CSV file (including the .csv extension) [2, 4, 10].
- You don't need to define the choices for this question in the
choices sheet of your XLSForm when using select_one_from_file or select_multiple_from_file [3].
-
Upload and Deploy your Form in KoBoToolbox:
- Upload your prepared XLSForm file to your KoBoToolbox project as you normally would [2, 4][1][2].
- Crucially, you need to deploy your form first before you can upload the external data file [2, 11][6].
-
Upload the CSV File to KoBoToolbox:
- After deploying the form, go to the Settings of your project in KoBoToolbox [2, 3, 11][1].
- Look for a section related to Media or Add Document [1, 2, 11][6].
- Upload your CSV file here[1][5][6]. KoBoToolbox treats external data files similarly to media files in this regard [2, 4].
-
Collect Data:
- Once both the XLSForm and the CSV file are uploaded and the form is deployed, when you open the form in KoBoCollect or Enketo, the choices for your question will be loaded from the uploaded CSV file [2, 3].
Benefits of Using External CSV Files:
- Improved Form Performance: Forms with very long choice lists load and navigate much faster [4, 11][6].
- Easier Management: You can update the external CSV file without needing to modify and re-upload your main XLSForm every time your choice list changes [3]. You still need to re-deploy the form after uploading an updated CSV [3][1].
- Supports Large Lists: Designed to handle thousands of choices effectively [2, 4, 11].
- Cascading Selects: You can still implement cascading select questions using external CSV files [2][2].
- Search Functionality: For extremely long lists, you can enable a search function in the form's appearance to allow users to type and filter the choices [1, 2, 11][6]. This is done by adding
autocomplete search() or similar syntax in the appearance column of your XLSForm for that question [1, 11].
Connecting via URL:
While you mentioned connecting via a URL for choices, the documentation primarily points to using the KoBoToolbox API for interacting with collected data or project information via URLs [2, 5, 6]. This is different from using a URL to dynamically populate a choice list within a form question for data collection in the same way that a CSV file does.
The KoBoToolbox API allows you to:
- Export data in various formats (including JSON) via a URL [2, 6][2].
- Query and filter submitted data using URL parameters [2][2].
- Connect KoBoToolbox data to other applications like Power BI or Microsoft Power Automate using REST services and URLs [2].
This URL functionality is more for integrating KoBoToolbox data with external systems after collection, rather than providing dynamic choice lists during data entry.
In Summary:
For your goal of having a high number of choices in your daily visit reports using KoBo Collect, the most appropriate and supported method is using external choice lists via CSV files. This involves creating a separate CSV file with your choices, referencing it in your XLSForm using select_one_from_file or select_multiple_from_file, and then uploading both the XLSForm and the CSV file to your KoBoToolbox project[3].
Remember to save your CSV as "CSV UTF-8" and ensure it uses commas as separators [1]. Deploy your form before uploading the CSV file [2, 11][2][6].
I recommend starting with the CSV method as it directly addresses your need for handling a large number of choices within the form itself. The documentation and resources available strongly support this approach [1, 2, 3, 4].