Preventing duplicate entries in a repeat loop

Hi, I am trying to collect the ID of participants within a household that have now moved house.
I have the following so far:
Q1. How many household members have moved since last contact?
Then a repeat loop with repeat_count set to be the answer to Q1 containing the question:
Q2. Please enter the ID of the household member(s) that have moved

Is it possible to prevent the same participant ID being entered more than once (ie duplicate answers to Q2)?

Welcome to the community, @saspackman! Is the household member you aim to be a finite number or an infinite number?

Hi, thanks for looking at my question!

I have not put any constraints on Q1 yet, but I will need to, so it will be a finite number if I have understood correctly.

@saspackman, maybe you could do it as outlined in the image shared below:

In the survey tab of your xlsform:

Data entry screen as seen in Enketo: when the same id is entered twice

Data entry screen as seen in Enketo: when a unique id is entered

Reference xlsform:

Restrict IDs already selected from a repeat group.xlsx (10.0 KB)

1 Like