SurveyLoopr
Tips & Tricks
13 min read

Fix the XLSForm allow_choice_duplicates Error

Mehrab Ali
Mehrab AliPublished November 17, 2026

The allow_choice_duplicates error means two rows in the same choice list have the same name, and the fix is to give every choice in a list its own name; only when the repeat is deliberate, as in some cascading selects, add a column allow_choice_duplicates with the value yes to the settings sheet. Most forms that hit this error have a copy-paste mistake, not a need for the setting. Every fixed example below compiles with pyxform and ODK Validate, the check ODK Central and KoboToolbox run on upload.

Download example form (.xlsx)All four fixed examples in one XLSForm, one group each. Tested with pyxform and ODK Validate; free to reuse under CC BY 4.0.Download

What does the allow_choice_duplicates error mean?

On the choices sheet, the name column holds the value that is saved in your data. Within one list_name, each of those values has to be different, otherwise two options would be saved as the same answer. The converter refuses the form when it finds a repeat. The current wording is:

[row : 5] On the 'choices' sheet, the 'name' value is invalid. Choice names must be unique for each choice list. If this is intentional, use the setting 'allow_choice_duplicates'. Learn more: https://xlsform.org/#choice-names.

Older converters, and many forum posts, show the same error in two earlier wordings:

There does not seem to be a `allow_choice_duplicates` column header defined in your settings sheet. You must have set `allow_choice_duplicates` setting in your settings sheet to have duplicate choice list names in your choices sheet
The name column for the 'children_regularly_clinic' choice list contains these duplicates: '1', '2'. Duplicate names will be impossible to identify in analysis unless a previous value in a cascading select differentiates them.

All three are the same problem. The oldest wording reads like an instruction to add a setting, which is why so many people add it. Read it as "a name is repeated" first.

How do I find the duplicate choice names?

Go to the row the error names. [row : 5] is row 5 of the choices sheet, counting the header as row 1, and it holds the second copy. The first copy is higher up in the same list. This list fails with [row : 5]:

Rowlist_namenamelabel
2water_source1Piped water
3water_source2Protected well
4water_source3Unprotected well
5water_source3Unprotected well
6water_source4Surface water (river or pond)

Row 5 is a pasted copy of row 4. Delete it:

typenamelabel
select_one water_sourcemain_waterWhat is the household's main source of drinking water?
surveychoicessettings
list_namenamelabel
water_source1Piped water
water_source2Protected well
water_source3Unprotected well
water_source4Surface water (river or pond)
water_source-96Other
surveychoicessettings

In a long list, let the spreadsheet find the repeats. With list_name in column A and name in column B, put =COUNTIFS(A:A,A2,B:B,B2) in an empty column and fill it down. Any row that shows 2 or more has a twin. Delete the helper column when you are done.

Note:

The check covers every list on the choices sheet, including lists that no question uses, and it reports one list at a time. After you fix the first list, validate again; a second list with a repeat will then show up.

Why is there a duplicate when every label is different?

Because the check looks at name, not label. Three things produce a repeat that is hard to see:

  • The same code typed twice. Two different options both got code 3, usually when a new option was inserted in the middle of a list.
  • A number and the same number as text. A cell holding the number 3 and a cell holding the text 3 are the same name. So are 3 and 3 followed by a space.
  • A list continued further down the sheet. Rows with the same list_name belong to one list wherever they sit. A second block of water_source rows 200 lines lower, numbered from 1 again, repeats every code.

The fix for all three is a code that is free in that list. Here "Pit latrine without slab" and "No facility" both had code 3:

typenamelabel
select_one toilet_typetoiletWhat kind of toilet facility does the household use?
surveychoicessettings
list_namenamelabel
toilet_type1Flush or pour-flush toilet
toilet_type2Pit latrine with slab
toilet_type3Pit latrine without slab
toilet_type4No facility (open defecation)
toilet_type-96Other
surveychoicessettings

If the form has already collected data, give the new code to the option that was added later and leave the older option's code as it is. Changing a code that is already in submissions changes what your old data means.

How do I fix duplicates in a cascading select?

Make each name unique by putting the parent's code in front. Cascading lists are where this error is most common, because the same place name exists under more than one parent: two unions can each have a village called Rampur. If both rows are named rampur, the form is rejected. Code them by union instead:

typenamelabelchoice_filter
select_one unionunionWhich union is the household in?
select_one villagevillageWhich village is the household in?union = ${union}
surveychoicessettings
list_namenamelabelunion
union1Char Bhadrasan
union2Gazirtek
village101Rampur1
village102Char Salepur1
village201Rampur2
village202Hajiganj2
surveychoicessettings

The two Rampur rows keep the same label, which is fine, and their names differ. This is the better fix in almost every case: village = 201 identifies one place on its own, so a table or a merge on the village column never mixes the two. The cascading selects guide covers the choice_filter column in full.

When should I set allow_choice_duplicates to yes?

When the repeat is real, the list is always filtered by a parent, and you will always analyse the two columns together. Ward numbers are the usual case: every union has wards 1 to 9, and the data team wants ward = 3, not ward = 203. Add one column to the settings sheet:

form_titleform_idallow_choice_duplicates
Household listinghousehold_listingyes

The choices sheet can then repeat a name under each parent:

list_namenamelabelunion
union1Char Bhadrasan
union2Gazirtek
ward1Ward 11
ward2Ward 21
ward1Ward 12
ward2Ward 22

The ward question still needs union = ${union} in its choice_filter, so the enumerator sees only one "Ward 1" at a time. In the data, ward = 1 means nothing without the union column next to it.

Warning:

The setting applies to the whole form. Once it is yes, a pasted row or a code typed twice in any other list is accepted without a word, and two different answers are saved as the same value. Use it only when you need it, and check the other lists by hand.

Why does the error stay after I add the setting?

Because the setting was not read. Each row below was run through the validator with the duplicate-ward form above:

What is in the formResultWrite instead
Column named allow_choice_duplicate (no final s)Same errorallow_choice_duplicates
Value 1 or ySame erroryes
Value noSame erroryes, or make the names unique
Column added to the survey sheetSame errorPut it on the settings sheet
Value Yes, YES, true or TRUEAcceptedNothing to change
Header Allow_Choice_DuplicatesAcceptedNothing to change

A misspelled settings column gives no warning of its own; the form just fails as before. The value goes in row 2, directly under the header, on the same row as form_title and form_id.

What does not count as a duplicate?

Three things that look like repeats are accepted without the setting:

  • The same names in different lists. Uniqueness is per list, so every yes/no list in a form can use 1 and 0.
  • The same label on two choices. Only name is checked.
  • Names that differ in any character. a and A, or 3 and 03, are different names. They compile, but they are easy to confuse in analysis, so avoid them.
typenamelabel
select_one yes_notreats_waterDoes the household treat its drinking water?
select_one yes_no_dksoap_seenIs there soap at the handwashing place?
surveychoicessettings
list_namenamelabel
yes_no1Yes
yes_no0No
yes_no_dk1Yes
yes_no_dk0No
yes_no_dk-99Don't know
surveychoicessettings

Labels are for the enumerator and names are for the data. Show the choice label, not the value explains how to print a label when you need one.

Common causes and the fix for each

Each broken version was run through pyxform; all of them returned the "Choice names must be unique for each choice list" error, with the row of the second copy.

What is on the choices sheetFixRow in the error
A choice row pasted twiceDelete one of the two rowsThe second copy
Two different options with the same codeGive the newer option the next free codeThe second option
3 as a number and 3 as text, or 3 with a trailing spaceKeep one; retype the other with a free codeThe second one
The same list name used again lower in the sheetRename the second list, or continue the numberingThe first repeated code
The same place name under two parents in a cascadePrefix with the parent code: 101, 201The second place
A repeat in a list no question usesDelete the unused list or fix itThe second copy

For other upload messages, see common XLSForm errors, or paste the form into the free XLSForm validator.

Does this work the same in ODK, KoboToolbox and SurveyCTO?

The rule is the same everywhere: one list, one value per choice. The wording and the column names differ.

PlatformWhat to know
ODK (pyxform, XLSForm Online, Central)The error appears on conversion or upload. allow_choice_duplicates goes on the settings sheet
KoboToolbox (XLSForm upload)The same converter runs on preview and deploy, so the message and the settings column are the same. Older Kobo forum posts show the earlier wordings
SurveyCTOThe choices sheet uses a column named value where ODK uses name. SurveyCTO has its own form checker, so the message is worded differently; keep values unique within a list all the same

Very long lists are easier to keep free of repeats in a CSV file than on the choices sheet. See searching large choice lists for select_one_from_file.

Why unique choice names matter in the field

A repeated name is not a formatting problem. If "Unprotected well" and "Surface water" are both saved as 3, no cleaning script can separate them afterwards, and the only repair is going back to the households. The validator stops the form at the desk, where the fix is one cell.

Tip:

Describe the list in plain language instead: "add a village question filtered by union, with these villages under each union". LooprAI writes the choices with unique numeric codes and compiles the form with pyxform and ODK Validate before anything is saved, so a repeated code never reaches your form.

Build my first form free

Next: common XLSForm errors →

Frequently Asked Questions

What does the allow_choice_duplicates error mean in XLSForm?

Two rows in the same choice list have the same value in the name column. Names are what gets saved in the data, so each one must be unique within its list. The error gives the row number of the second copy on the choices sheet.

How do I add allow_choice_duplicates to the settings sheet?

On the settings sheet, add a column with the header allow_choice_duplicates and type yes in row 2, on the same row as form_title and form_id. Do this only when the repeated names are deliberate, for example ward numbers under each union in a cascading select.

Why do I still get the error after adding allow_choice_duplicates?

The setting was not read. Check the spelling, including the final s, make sure the column is on the settings sheet and not the survey sheet, and use yes as the value. A value of 1 or y is ignored and the form fails as before.

Should I allow duplicate choice names or make them unique?

Make them unique in almost every case. Codes such as 101 and 201 identify one village on their own. With duplicates allowed, a value only has meaning next to its parent column, and real copy-paste mistakes in other lists are no longer caught.

Can two different choice lists use the same names?

Yes. Names only have to be unique inside one list. A yes_no list and a yes_no_dk list can both use 1 and 0 without the setting. Two choices in one list can also share a label, because only the name column is checked.

How do I find duplicate choice names in a long list?

Start at the row number in the error; it is the second copy. For a full check, add a helper column with =COUNTIFS(A:A,A2,B:B,B2), where column A is list_name and column B is name. Rows that show 2 or more are repeated.

No Credit Card Required

Build the form first. Add hosting when you need it.

Start free with LooprAI, then deploy a managed ODK Central server or run DataSnap checks when your project is ready.

Automation handles the mechanical work.

Researchers decide what the evidence means.