Remove Text Field on Multiple Choice? Blank fields?

I'm working on my first form for use in ODK Collect and I've run a couple of problems.

  1. For some reason on my multiple choice questions there is a text input field, which the cursor defaults to. This makes it so that you have to scroll to see the full list of multiple choice options when the list is more than 4 items. Why is text input even an option on a multiple choice question?

example: https://i.imgur.com/9Y7seJ6.jpg

  1. I have several multiple choice questions pulling from the same external CSV file. These questions have different numbers of possible answers, resulting in blank spaces within the CSV file. This results in one blank option on each multiple choice question for which there are blank rows.

example: https://i.imgur.com/GRgwRVX.jpg

Selecting this blank option results in an error:

"don't know xml value! perhaps selection was stored as index only and has not yet been linked up to a formdef?"

How do I prevent this?

I'd like to upload my form and CSV file, but I'm not sure how.

I think I know why the text fields are showing up. The syntax for selecting data from an external CSV file for a select_one question is "search('filename')". The problem is "search" is also an appearance callout that adds a text field. Is there any other appearance type that can be used to select data from an external CSV file?

in your first example you are using a single select option with search appearance that is why the text input appear on the page, the text input is only to guide you to filterer out the answer option you are looking for. so when you begin typing in the answer option that matches with the answer option, it will be filtering it out for you.

check in your CSV file to make sure that all the columns end in the same row and all. or if you are filtering the answers from previous answer options make sure you check your filter list.

you can share a sample file so that we can look at it and help you fix what ever you are looking for.

thank you.
fabla2020@gmail.com

Right, I used the search('filename') appearance because that's how the XLSForm instructions say to reference data from an external CSV within a select_one. Is there any other way to do it, or am I stuck with the text field? I really don't want the text field.

The columns do not end in the same row. They can't, because the number of acceptable responses for each question varies for the same part number. I've attached my form .xls and the CSV file below.

FormTest1.xlsx (10.2 KB)
hss_parts.csv (2.0 KB)

Hi @AaronF, i will like to find out if the following are independent of each other

  1. Outside Diameter Measurement
  2. Inside Diameter Measurement
  3. Thickness Measurement
  4. Concentricity Measurement
    or they depending on each other, so that i will be able to give my recommendation.

Hi Fabla,

They do not depend upon each other, but they are dependent upon the part number (PW002 or 6408-61-17-0111 in my example hss_parts file).

Are you thinking of referencing four separate CSV files? I'd like to be able to maintain all the data in one file if possible because I am going to have about 500 different parts in here when this is fully implemented.

So I did what I think you were getting at, and split the different measurements out into different CSV files. It worked, it got rid of the blank fields.

That still doesn't solve the problem of the text-input field on select questions though.

@AaronF,

yes that is cool, the blank field you are seeing is the empty spaces which does not allow the columns to end in the same row, so if you want it do work without the blank field while having all the columns in one will you can fill the empty cells with something like Not Applicable and tell data collectors not to choose that option, you can even put a constraint on that option to prevent anyone from moving ahead when he/she choose that option.

to do away with the text field you can use this quick search('hss_parts') in the appearance field.

to do away with the text field you can use this quick search('hss_parts') in the appearance field.

That is exactly how the screenshot I posted is formatted. It still puts in the text field.

I used the search('filename') appearance because that's how the XLSForm instructions say to reference data from an external CSV within a select_one. Is there any other way to do it, or am I stuck with the text field? I really don't want the text field.

@AaronF this is a known bug that will be fixed in the next Collect version. You can read more details and follow progress on it at https://github.com/opendatakit/collect/issues/2502. You can build your form with search('filename') and as soon as devices update with the next release (mid to end September), the text field will go away.

Interesting timing, I just finally filed that issue yesterday!

1 Like

Well that's good to know. Thanks.