Need advice formatting a form so the data in downloaded excel file is presented logically

Hi,
I’ve created an online register so people filling in the form can select names of attendees from a list. When I download and export the data, all the selected names appear in the same cell without a delimiter to separate the names from each other. Each of the following columns relates to one person on the register and it marks 1 in their cell if they were selected as attended on the form and 0 if they were no selected. We have around 100 people on the form so if I select 20 people as attended it looks like 20 attended and 80 did not when in fact, they weren’t expected to attend but they are on the form so we can use one register for all classes and do not have to build different registers for different class groups. Here’s the link to the form: https://ee.kobotoolbox.org/x/HcHqZYl8

Also, what is the limit for the number of values which can be help for one field as we are hoping to use one register for all out classes which would mean uploading 16k names of people to the form. Is that possible?

Hi @nicolagibba
What I see here is a potential loophole in how you created your form. You have already indicated that these represent different classes of people. I would suggest you use the feature cascading select. However, considering that you are looking at a much larger list, it would be important to know which mode of data collection you intend to use. This will help us know whether we should recommend for y ou working with an external CSV file. I have been working on a support article to document that but I can present details of what you may need to do below.

Select One or Many From an External File Question Type¶
In some cases, it may be desirable to host a list of choice options in an external file, rather than directly in the project XLSForm. For example, a long list of choices (e.g. hundreds or thousands) could slow down the loading and navigation of the form, or adding new choice options after data collection has begun could sometimes be troublesome.
This article provides a detailed example and method for creating a select one or select many question types with the choice list in a separate external file.
There are two approaches we have tested for the different data collection methods (using the android collect application and using Enketo webform). It should be noted that none of these two methods support both data collection methods
Approach 1: Using search () in the appearance column.
NOTE:

  1. This method will only work on the android collect application. The original writeup can be found here (https://xlsform.org/en/#dynamic-selects-from-pre-loaded-data).
  2. This method does not need you to execute choice_filter for cascade questions since this is done using one of the search functions i.e. matches (see below)
    Step 1: In the XLSForm, within the survey sheet, specify select_one listname or select_multiple listname in the type column (where listname is the name of your choice list) as you would normally do when defining a select_one or select_multiple respectively.

Step 2: On the appearance column (survey sheet), define the search function as you would desire.
There are five ways you can use the search function:
• contains- this will check and return all the items in the csv column you need but only for rows which the filtration column contains the specified parameter within any part of the text in the filtration column.
• beginswith- this will check and return all the items in the csv column you need but only for rows which the filtration column beginswith with the specified parameter.
• endswith- this will check and return all the items in the csv column you need but only for rows which the filtration column endswith with the specified parameter.
• matches- this will check and return all the items in the csv column you need but only for rows which the filtration column matches the specified parameter in full to the specified parameter.
• You can also use search without any of the four elements, in this case, you will have the entire list without any filtration applied.

Please note for this example, we are using the “matches” approach and the search without any additional function.
You will define your search in the column as follows:
search (‘nameofcsv’, ‘matches’, ‘filtercolumnincsv’, ${questionnameinxlsform})
In this example, we are using a csvfile known as countriesbyregions to get various lists.

To understand the example, see the structure of the used CSV file.

If you need to use any other appearance style such as minimal, you will need to define it before the search appearance followed by a space e.g. minimal search () or minimal autocomplete search ()

Step 3: On the choices sheet of your XLSForm, you will need to define how your list will be built from the csv file:
• list_name column: specify the name of your choice list as you normally would.
• name column: include the name of the .csv column to use for uniquely identifying selected choices.
• label column: include the name of the .csv column to use for labelling the choices.
Note: If you wish to include multiple columns in the labels, include a comma-separated list of all columns to include. The name column will be dynamically populated based on the column name you put there, and the label column will be dynamically populated based on the column name(s) you put there.
• In your choices worksheet row, you may also include a .csv column name in the image column. If you do, the image filename to use will be pulled from the specified .csv column.
Note: If you refer to image files in this way, you must always upload those image files as media file attachments when you upload your form to the server.

Using our example, the definition in the choices sheets will be as follows (look at our earlier CSV)

Note:

  1. The contents of the columns within the csv that will provide the contents of the name, must meet all the requirements of creating a name in the XLSForm choices sheet.
  2. If you need to pull the label for multiple languages, you can still specify the column that provides them using the same approach above.
    Step 4: Upload and deploy your XLSForm as normal. Then upload the csv within the media section as shown below

Approach 2: Using select_one/multiple_from_externalcsvname.csv
_Please note:
• At the moment, this feature is only available using XLSForm and the data can only be entered through Enkidu and is not supported by ODK or KoBoCollect.
_* There is an outstanding bug that causes an error when trying to view or download the collected data. For now, you can go around this by using the legacy version of KoBo (kc.kobotoolbox.org or kc.humanitarianresponse.info).
Step 1: In the XLSForm, the type should be either select_one_from_file + (file name with a CSV extension) or select_multiple_from_file + (file name with a CSV extension) as shown in the figure below:

Please note: The fruits.csv is the file name containing the choices for the question “What is your favourite fruit?”.
Step 2: In the choices sheet of the XLSForm, type the name of the variable (i.e. fruits) under list_name and leave the name and label values as just name and label as shown in the figure below:

Step 3: Create a new csv file and structure it the same as the choices tab in the XLSForm and label the tab the same as the variable you used in the XLSForm. Under the list_name column, type the variable name for each row. Under the name and label columns, create your custom choice options as shown below:

Step 4: Upload and deploy the XLSForm in KoBoToolbox.
Step 5: Upload the external csv file the same way you would add a media file to the form: Click the + Add Document button in the Media tab of the project SETTINGS page. After the file is uploaded and shown above, return to the main SETTINGS page and click the Save Changes button.

Please note: You are only able to upload the CSV file after you have deployed the form.

Stephane

1 Like