So sorry about the delay in getting back to this!
You can find @joybindroo's example adapted to use Entity Lists here.
To try it out:
- create and publish the form
- go to the
households
Entity List add the "household" property. We need to add this one manually because the form doesn't save to it. - upload households.csv (99 Bytes) to the
households
Entity List (docs) - try the form out using a web form or assign the form to an App User to try it in Collect
To see the id update within a single household, you will need to refresh the form in between adding new household members. If you'd like to see updates happen offline, you can try the latest Collect beta with Central v2024.2.0 following the instructions here.
Example with household and participant Entity Lists
You can find a more complex example using a participant Entity List here.
This example demonstrates doing a little bit more participant management by giving the option to archive a participant in addition to adding a new one.
To try it out:
- if you've been experimenting with the form above, you'll need to create a new project for this one because both have a
households
Entity List with a different structure - create the
households
Entity List (docs). This one isn't modified by the form so it needs to be created ahead of time. - add the following properties to the Entity List you just created:
village
andhousehold
- upload households.csv (736 Bytes) to the
households
Entity List (docs) - create and publish the form
- go to the
participants
Entity List that was created by the form, add thevillage
andhousehold
properties - upload the participants.csv (7.1 KB) to the
participants
Entity List (docs) - try the form out using a web form or assign the form to an App User to try it in Collect
Some things to note:
- The village and households lists feel like they might not be needed. They're convenient for specifying labels, but maybe the ids would be enough. This is the same issue that @TomJ described in the idea to have a
unique
/distinct
function - If you upload the household and participant CSVs as I created them, their order will look backwards in clients. This is related to the idea to make Entity List sortable
- There's a lot of computation going on in this form! I would want to try some test data with my target devices if I wanted to use this for more than 20,000 participants or so
I know there's a lot going on in these examples! They were a good opportunity to illustrate several different Entities-related ideas. Hopefully you can take what you find interesting and leave the rest behind.