I'm working on my first form for use in ODK Collect and I've run a couple of problems.
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?
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.
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.
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.
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.
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.
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!