Populating choices with external data

02-10-2021 07:25 AM
New Contributor III

Does Survey123 allow you to populate select_one choice lists from an external database or a feature table in ArcGIS Online?

I've worked with the pulldata() function which can populate lists from static data stored in a CSV, but my current scenario requires a dynamic data source.

Tags (2)
0 Kudos
4 Replies
Esri Contributor

Choice lists are essentially coded values in ArcGIS and these are configured and stored in your feature layer's configuration, so there is no getting around that.
You could have a look at using some JavaScript in your survey to query other feature services. There is a blog that would give you a good head start and see if this is something you could make use of.

Custom JavaScript functions in Survey123 

Hope this helps.

MVP Honored Contributor

This is coming in the new version, 3.12, of 123 due out this month.  You can also join the Early Adopter program to try it now.

Dynamically loading choices from feature services

The search() appearance allows you to query ArcGIS feature services and populate choice lists based on the results of the search query. When using the search() appearance with ArcGIS services you can use @geopoint, @geotrace, and @geoshape for the searchColumns depending on the geometry of the feature service you are querying.

For search type the following searchTypes are supported, this list comes from the spatial relationship parameter when querying a feature service or layer :

This assumes being online of course.  There will also be a way to link to online csv files.

Hope that helps

New Contributor III

hi. I'm now running 3.12 Connect. Via the Linked Content I'm able to populate a choice list from a CSV hosted on AGOL. It appears that the Survey needs to be republished for the choice list to update, I don't believe there's the ability the dynamically read the hosted CSV each time the Survey is opened? I haven't looked into the JavaScript option for pulling data from a hosted CSV, but wouldn't that require the need to republish the Survey to update the choice list?

0 Kudos
MVP Honored Contributor

No you can manually, or with script, upload a new CSV to AGOL directly also.  I have not used it so not well versed.

0 Kudos