Avoid duplicate answer in in repeat group


I have this form which is the household level form:
Part A:
I ask the number of household member ?

Part B. Individual questions - I use repeat group to generate this Individual questions based on the answer on number of household member.

In Part B, I have the question on Individual ID (This is the select one question) - I want to put constraint that the enumerator can pick each answer only one time regardless of the number of household member.

For example: If the household have 2 members, so the repeat group appear 2 times. I want that the enumerator to be able to pick each answer only one time:
Person 1.
What is the ID for person 1?
a. 01
b. 02
Answer can be : d.04

Person 2:
What is the ID for person 2?
a. 01

answer can be: a, b, c but NOT d

I have search for some example, but it does not work? I attached my form here, the question is on row 37, I have some constraint function there, but not sure why it does not work

Hope you can help,
OkardLacoviss.xlsx (26.9 KB)

I found the answer in previous discussion :


Thank you for confirming!


I found the solution, but I also found another related problem.

here is the update form,
1. Household Enrollment Questionnaire.xlsx (27.3 KB)

I have enter data in the form and it works okay for the first used, but the situation is, the respondent are not all home and some data may not be able to capture at the first visit, so they have to save the form and come back. I found that when they come back to the form the restriction related to individual ID number which was fine before, has been showed error in edit form,

Attached is the screenshot

Hope you can help,

@Okard, would you mind validating your xlsform through this online validator to see if you are able to find out any syntax issues that are present within your xlsform?

It only shows this

Fix it and move forward to see if you are able to get any.

@Kal_Lam , I did but seems like the problem does not related to the one identified by the website

OK, great till now. So try to focus on where the issues are seen.


Maybe you will need to extract the section of your xlsform to limit the same to simply capture the repeat and see if the same works there. If it works smoothly there then you will need to proceed with the other parts. And you will need to do this in parts.