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:
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!
No you cannot prepopulate more than 1 repeat at a time.
Bummer, I was so hopeful. Thanks @DougBrowning. I'll head back to the drawing board!
I think maybe with repeat count it will load X number at once. Then as they scroll through them the pulldata should fire as they go. That may be enough for you? It will just not load them until they scroll to them. Not sure how you would control which one loads in each repeat though.