Populating fields from csv

681
2
Jump to solution
05-16-2022 10:17 AM
GregKeith
Occasional Contributor III

Howdy,

Having a problem populating fields based on a csv. I have a csv file, contact.csv, with three contact info fields: contact_name, contact_phone and address like this:

contact_name,contact_phone,address
Carol Danvers,(123) 456-7890,123 Kree St Bangor ME 01234
Steve Rogers,(321) 654-0987,1600 Penn Ave Wash DC 01010
Fred Munster,(699) 699-6000,1313 Mockingbird Ln Chico CA 9876

On my form, I can populate a select one question with the contact name using:

                           type                              name                         label                     appearance
survey sheet - select_one contact     cont_name         Contact Name     minimal search('contact')

                            list_name                 name               label
choices sheet - contact                      cont_name     contact_name

But after selecting a name from the select_one, the other fields, e.g. phone, don't populate:

                           type        name                 label                     calculation
survey sheet - text    cont _phone      Contact Phone     pulldata('contact', 'contact_phone', 'contact_name', ${cont_name})

Hopefully this makes sense. How can I get the other fields to populate from the csv row matching the contact name? Thanks!

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @GregKeith

On the choices worksheet the name and label for the contact choice list will both need to be contact_name. With what's set now no matter what choice is selected cont_name will be returned from the choice list and that doesn't match the values in the CSV. 

Thank you,
Zach

View solution in original post

2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @GregKeith

On the choices worksheet the name and label for the contact choice list will both need to be contact_name. With what's set now no matter what choice is selected cont_name will be returned from the choice list and that doesn't match the values in the CSV. 

Thank you,
Zach
GregKeith
Occasional Contributor III

Awesome, thanks Zach!

0 Kudos