External Choice List with Select Multiple - All Answers Being Selected

177
4
Jump to solution
2 weeks ago
aytlDEC
New Contributor II

I'm trying to set up a form in Survey123 Connect to have two questions:

  • the first question asks for a facility number
  • the second question is supposed to have an external choice list. The responses displayed should consist of the names of the tanks within the facility identified in the first question. (Choice filter for this question is tied to a CSV called PBSData.)

When the second question type is set as "select_one_from_file PBSData.csv", the responses shown have radio buttons and the user is able to select just one of the tank names. However, if it's set as "select_multiple_from_file PBSData.csv", the radio buttons do become checkboxes but clicking on one checkbox causes all of the checkboxes to be ticked.

Has anyone run into this issue previously? It seems like I'm missing something basic.

0 Kudos
1 Solution

Accepted Solutions
ChristopherCounsell
MVP Regular Contributor

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-external-choice/ba...

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-choice-filters/ba-...

 

How to create an external choice list

External choice lists are stored as CSV files. Unlike the choices worksheet in your XLSForm, which can contain multiple lists in a single worksheet, a CSV file can only contain one list.  The rules to create the CSV file are:

  • The filename cannot contain spaces. The name of the file, becomes the name of your list.
  • You must include at least two columns: name and label (just like in the choices worksheet):
    • The name column includes the choice codes. No special characters, spaces or duplicates allowed.
    • The label will be used to present the choice to the user.

The CSV has no 'name' column. It won't work without a name column. 

Not sure why there is a regex function in the choice filter column. It would return 'true' if the input was correct but I don't think it applies an actual filter?

I would recommend reading the blog post above. To achieve what you are after you would:

  1. Create a CSV with two columns - 'name' and 'label' - these are your tank options. Name is the value, label is what the user sees. Don't use special characters in the name column.
  2. Add a third column e.g. 'facility' that can act as your choice filter. e.g. tanks ABC, ABD, ABE can be allocated to X facility if the 'X' value matches the facility column.
  3. Add a choice filter to your select_multiple question: facility=${Fac_No}

View solution in original post

4 Replies
ChristopherCounsell
MVP Regular Contributor

Can you share the spreadsheet?

I would guess that it's not formatted quite right. Check the fields/columns are named correctly and the values within are correct

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-external-choice/ba...

 

aytlDEC
New Contributor II

Apparently I can't upload CSVs but here are screenshots of the CSV, the xls form, and the form itself. I'm fairly positive it's formatted correctly since it's a really basic form.

PBSData.jpg

XLSForm.jpg

Form.jpg

   

0 Kudos
ChristopherCounsell
MVP Regular Contributor

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-external-choice/ba...

https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-choice-filters/ba-...

 

How to create an external choice list

External choice lists are stored as CSV files. Unlike the choices worksheet in your XLSForm, which can contain multiple lists in a single worksheet, a CSV file can only contain one list.  The rules to create the CSV file are:

  • The filename cannot contain spaces. The name of the file, becomes the name of your list.
  • You must include at least two columns: name and label (just like in the choices worksheet):
    • The name column includes the choice codes. No special characters, spaces or duplicates allowed.
    • The label will be used to present the choice to the user.

The CSV has no 'name' column. It won't work without a name column. 

Not sure why there is a regex function in the choice filter column. It would return 'true' if the input was correct but I don't think it applies an actual filter?

I would recommend reading the blog post above. To achieve what you are after you would:

  1. Create a CSV with two columns - 'name' and 'label' - these are your tank options. Name is the value, label is what the user sees. Don't use special characters in the name column.
  2. Add a third column e.g. 'facility' that can act as your choice filter. e.g. tanks ABC, ABD, ABE can be allocated to X facility if the 'X' value matches the facility column.
  3. Add a choice filter to your select_multiple question: facility=${Fac_No}
aytlDEC
New Contributor II

That worked - much obliged.