Auto select from external choice list

611
2
Jump to solution
05-19-2022 10:19 AM
JaredRyan1
New Contributor III

@JamesTedrick @IsmaelChivite,

I'm currently trying to record the County FIPS number for the county returned by our locator (custom in portal) when using reverse geocoding.

The Background:

Currently we have the county FIPS number stored in and exteranal_choices tab our survey123 form, like this:

list_namenamelabelstates_territories
countyAL01001AutaugaAL

 

So that when the user selects the state_territories, they're given the associated list of counties to select from. We then store the name, in this case the FIPS, for reporting use.

While the state and county questions are populated by a select_one, the address, city, and zip are auto populated via reverse geocoding.

The issue:

My users want to be able to have the state and county fields auto populate just as the address, city, and zip do and not have to select a county or state.

This poses any issue since we're needing to collect the FIPS data and the locator does not provide it (as far as I have found). 

-SO-

Is there a way to auto select the correct FIPS from the external choice list that correlates to the state/county values returned by the locator?

Any pointers will be wildly appreciated!

0 Kudos
1 Solution

Accepted Solutions
ZacharySutherby
Esri Regular Contributor

Hello @JaredRyan1

If you are looking for this to be offline you will need a CSV that has what county each zip code is in. Ex.

zipcountyfipsstate
92373San BernardinoCA06071CA
92223RiversideCA06065CA

 

From there you can use a pulldata() function to populate the information. 

If this is an online survey then you can do a point in polygon lookup either using a JavaScript function or the search() appearance. 

Thank you,
Zach

View solution in original post

0 Kudos
2 Replies
ZacharySutherby
Esri Regular Contributor

Hello @JaredRyan1

If you are looking for this to be offline you will need a CSV that has what county each zip code is in. Ex.

zipcountyfipsstate
92373San BernardinoCA06071CA
92223RiversideCA06065CA

 

From there you can use a pulldata() function to populate the information. 

If this is an online survey then you can do a point in polygon lookup either using a JavaScript function or the search() appearance. 

Thank you,
Zach
0 Kudos
JaredRyan1
New Contributor III

Thank you, Zach! 

I did end up creating a csv with the appropriate data in it, but I was using the "search" appearance. Would a pulldata function be more appropriate here then?

For the pulldata function, I've hosted the csv in or portal and added to the survey's linked content. Then downloaded it from the linked content page in the survey so that the csv and info file were added to the media folder. 

I'm using the follow calc with a positive return:

pulldata('external_choices','name','county',${county_rev_geocode})

Thank you Zach!

0 Kudos