Example conversion
A household survey, from questionnaire to XLSForm.
One real conversion, shown in full: the questionnaire that went in, the XLSForm that came out, and the item flagged for review.
Sample data. The questionnaire is synthetic, written for testing; there is no real survey or respondent behind it.
- Validated with pyxform: passed
- One item flagged for review
- Converted
What went in
Rural Household Livelihood Survey 2026 - Short Questionnaire
SECTION A: IDENTIFICATION
A1. Date of interview (dd/mm/yyyy)
A2. Name of interviewer
A3. Province: 1 = Northern 2 = Central 3 = Southern
A4. GPS location of the dwelling (record coordinates)
CONSENT
Read aloud: "Hello, my name is ____. We are conducting a survey about household livelihoods. Participation is voluntary and your answers are confidential."
A5. Does the respondent agree to be interviewed? 1 = Yes 2 = No (If No, end the interview)
SECTION B: HOUSEHOLD ROSTER
(Complete one line for each person who usually lives in the household)
B1. Name of household member
B2. Sex: 1 = Male 2 = Female
B3. Age in completed years (0-98)
B4. Is [NAME] currently married? 1 = Yes 2 = No (Ask only if age is 15 or older)
B5. What is [NAME]'s main occupation? 1 = Farming 2 = Trade 3 = Salaried work 4 = Student 5 = Other (specify)
SECTION C: HOUSING AND ASSETS
C1. What is the main source of drinking water? 1 = Piped water 2 = Borehole 3 = Surface water 4 = Other (specify)
C2. Does the household own any livestock? 1 = Yes 2 = No -> If No, go to C4
C3. How many cattle does the household own? (number, 0-500)
C4. Which of the following does your household own? (Select all that apply)
a. Radio b. Television c. Bicycle d. Motorcycle e. Mobile phone
C5. How many rooms does the household use for sleeping? (number, 1 to 20)
SECTION D: FOOD SECURITY
D1. In the last 30 days, did you worry that food would run out? 1 = Yes 2 = No
D2. If yes, how often? 1 = Rarely 2 = Sometimes 3 = Often
D3. Any comments from the respondent about food availability?
What came out
The survey sheet, row by row, in XLSForm’s own terms: relevant (skip logic), constraint (allowed answers), repeat (the household roster) and choice lists.
| type | name | label | hint | required | relevant | constraint | constraint_message |
|---|---|---|---|---|---|---|---|
| begin_group | section_a | SECTION A: IDENTIFICATION | |||||
| date | a1_interview_date | Date of interview (dd/mm/yyyy) | |||||
| text | a2_interviewer | Name of interviewer | |||||
| select_one province | a3_province | Province | yes | ||||
| geopoint | a4_gps | GPS location of the dwelling (record coordinates) | yes | ||||
| end_group | |||||||
| begin_group | consent | CONSENT | |||||
| note | consent_statement | Hello, my name is ____. We are conducting a survey about household livelihoods. Participation is voluntary and your answers are confidential. | |||||
| select_one yes_no | a5_consent | Does the respondent agree to be interviewed? | If No, end the interview | yes | |||
| end_group | |||||||
| begin_group | section_b | SECTION B: HOUSEHOLD ROSTER | ${a5_consent}='1' | ||||
| begin_repeat | hh_roster | Household members | |||||
| note | b_instr | Complete one line for each person who usually lives in the household | |||||
| text | b1_name | Name of household member | yes | ||||
| select_one sex | b2_sex | Sex | yes | ||||
| integer | b3_age | Age in completed years | yes | . >= 0 and . <= 98 | Age must be between 0 and 98 | ||
| select_one yes_no | b4_married | Is [NAME] currently married? | Ask only if age is 15 or older | yes | ${b3_age} >= 15 | ||
| select_one occupation | b5_occupation | What is [NAME]'s main occupation? | yes | ||||
| text | b5_occupation_other | Other (specify) | ${b5_occupation}='5' | ||||
| end_repeat | |||||||
| end_group | |||||||
| begin_group | section_c | SECTION C: HOUSING AND ASSETS | ${a5_consent}='1' | ||||
| select_one water_source | c1_water | What is the main source of drinking water? | yes | ||||
| text | c1_water_other | Other (specify) | ${c1_water}='4' | ||||
| select_one yes_no | c2_livestock | Does the household own any livestock? | yes | ||||
| integer | c3_cattle | How many cattle does the household own? | yes | ${c2_livestock}='1' | . >= 0 and . <= 500 | Must be between 0 and 500 | |
| select_multiple assets | c4_assets | Which of the following does your household own? | Select all that apply | yes | |||
| integer | c5_rooms | How many rooms does the household use for sleeping? | yes | . >= 1 and . <= 20 | Must be between 1 and 20 | ||
| end_group | |||||||
| begin_group | section_d | SECTION D: FOOD SECURITY | ${a5_consent}='1' | ||||
| select_one yes_no | d1_worry | In the last 30 days, did you worry that food would run out? | yes | ||||
| select_one frequency | d2_frequency | If yes, how often? | yes | ${d1_worry}='1' | |||
| text | d3_comments | Any comments from the respondent about food availability? | |||||
| end_group |
The choices sheet
| list_name | name | label |
|---|---|---|
| province | 1 | Northern |
| province | 2 | Central |
| province | 3 | Southern |
| yes_no | 1 | Yes |
| yes_no | 2 | No |
| sex | 1 | Male |
| sex | 2 | Female |
| occupation | 1 | Farming |
| occupation | 2 | Trade |
| occupation | 3 | Salaried work |
| occupation | 4 | Student |
| occupation | 5 | Other (specify) |
| water_source | 1 | Piped water |
| water_source | 2 | Borehole |
| water_source | 3 | Surface water |
| water_source | 4 | Other (specify) |
| assets | radio | Radio |
| assets | television | Television |
| assets | bicycle | Bicycle |
| assets | motorcycle | Motorcycle |
| assets | mobile_phone | Mobile phone |
| frequency | 1 | Rarely |
| frequency | 2 | Sometimes |
| frequency | 3 | Often |
Flagged for review
- B roster: No roster count question printed, so repeat count left out.
Every form is converted with pyxform before you see it, and anything doubtful is listed like this. Review each form before you field it.
Convert your own
Free during the pilot, with an access code. Pilot limits and access