How to restrict the data with only one Head of Household from within a household survey?

Dear Esteem Users,
I want to restrict only one member of the household is the head. my data collectors currently can leave it blank (no head of household) or can select more than one member as the head.
i will appreciate your help.


This is interesting topic.!

You can do it multiple ways. One of the ways is to force the users to select HH Head in the first iteration and can not select this option other than first iteration. To do this use this constraint in relation selection question


Assuming choices list look like below format:

list_name label name
relation Head 1
relation Husband 2
relation Wife 3

Thanks for the response @azadkhan, i have been away for sometime. please kind give me further clarification/guidance. i try to use the the code you suggested in the constraint section of relationship but id doesn’t seem to work. does the repeat_position refer to the roster please i need this. below is how enter the code
if (${HouseholdRoster}=1,.=1,.>1) is it OK

if (${HouseholdRoster}=1,.=1,.>1)

Hi @Mumlaqs
I would like to answer your query using broad perspective on how to best customize forms.

  1. The first step would be to create a logic for what you want to do, makes it very easy to create rules. An example in this case would be
    a) The first person in the household must be head of household
    b) The second and subsequent person cannot be head of household

  2. With the logic take the shortest path to execution, in this case you have to ask your self how to execute the components in 1 (a) and 1 (b) above

  • For 1 (a)
    -Ensure that the response labels have an order of say 1=Head of Household, 2=Spouse/Partner 3=Daughter etc as you desire. You can then set a constraint that on the first member of household the response must be equal to 1
    -For the second component i.e. 1 (b) your logic should be as simple as not equal to 1.

This is the shortest way to execute this. However depending on whether you want to use repeat questions, or just a group of individuals questions, the execution will follow the same logic but must address the repeat index discussed here in this will ensure that for the first index of the repeat the condition must satisfy the equal to 1 and for the subsequent greater than 1 when responding to 1(a) and 1(b). In this case you can use the if command in your constraint together with the index-repeat to execute the function.

Now try and fiddle with this based on how your form is set to get it done. Wishing you all the best


1 Like

Hi @Mumlaqs,

Please tryout as shown in the image below to restrict your data with only 1 (or with at least 1) head of the household from within your household roster survey form.

In the survey tab of the xlsform:

In the choices tab of the xlsform:

Reference xlsform:
Head of the HH.xls (29 KB)


1 Like