Hi team,
We would like to add a custom id to new households that are being added by CHVs.
I there a way we can run custom update to update these households as well as members of these households.
Thank you.
Erick
Hi team,
We would like to add a custom id to new households that are being added by CHVs.
I there a way we can run custom update to update these households as well as members of these households.
Thank you.
Erick
I think this probably depends on how “custom” you need the value to be. The generate_shortcode_on_contacts
transition is a really easy way to get a shorter numeric id (that is guaranteed to be unique) set on contacts. However, there is no way to really control the shape (or content) of the id value that gets set.
Perhaps others have additional tricks they can share for setting custom fields!
Can you share more details about where these custom ids come from and/or how they need to be calculated?
Hi @jkuester ,
We have a unique Id that we created for study purposes.
After initial census, every household and the respective members were assigned a unique identifier.
We would like to add this Identifier when a new member has been added to the household.
For now it I’m not able to do it in the code since the context is not loaded when creating a new person.
Any insights will be helpful.
Thank you.
Erick
We have a unique Id that we created for study purposes.
Okay, it sounds like these are existing external values that are already assigned to the various households/members (but that data does not exist in the CHT). Just to be sure, are the household and member ids all distinct? (Or do the members have the same identifier as the household place and the other members of the same household?)
We would like to add this Identifier when a new member has been added to the household.
So, for your purposes, do you just need to add the value to new contacts, or do you also need to backfill data into existing contacts?
the context is not loaded when creating a new person
What do you mean by “context” here? (How are the identifiers being stored currently?)
Adding to the new contacts only.
“Context” I was referring to the contact-summary.
Erick
Okay, so how are the identifiers being stored now? How do you know which Id is associated with which contact?
I’ve added a variable called subjid. Yes, I know which Id is associated with which contact.
For example, if the ID of the last member of a given Household is xxx-4, the new household member should xxx-5.
Thank you
Ahh, got it. So, I assume xxx
is the identifier from the household?
You should be able to use a contact selector to load that id from the household contact when adding a new household member, but sadly I have not been able to think of a way to calculate the additional number (based on the current household member count). Maybe someone else out here has an idea?
Yes, that is right.
Will wait to hear from any other team member.
Thank you.
Erick
There unfortunately isn’t a way to do this as far as I know