Hi GeoNet Community!
I am working with Survey123 and XLSForm, and I want to dynamically prepopulate a repeat group with household members from a CSV file. Each household member should have their own repeat record, populated with data from the CSV, based on their HouseholdID.
Here's the scenario:
I have a CSV (vPersonTable123.csv) that contains household information with columns for HouseholdID, person_name, and Notes. I want to create a repeat group where:
- Each household member has their own record in the repeat.
- The PersonName and Notes are prepopulated for each member based on their HouseholdID.
I want to avoid using a select_one_from_file field, as I need the repeat to dynamically load all members based on the HouseholdID.
Here's what I’ve tried so far:
| type | naem | label | calculation |
| integer | HouseholdID | HouseholdID | |
| begin repeat | household_members | Household members | |
| select_one_from_file vPersonTable123.csv | person_name | PersonName | pulldata("vPersonTable123.csv", "HouseholdID", "name", ${HouseholdID}) |
| text | person_note | Notes: | pulldata("vPersonTable123.csv", "person_note", "name", ${person_name}) |
| end repeat | | |
However, this isn't returning the expected result. Instead of allowing for multiple prepopulated records based on the CSV file, it seems to only pull one result.
How can I correctly populate the repeat group with each household member’s data, without needing a select_one_from_file dropdown? Any guidance or examples would be greatly appreciated!