I'm hoping to create a pop-up note when a selected response is not within a list of set responses. I believe it is possible using the selected(question,value) formula in the relevant column and some sort of substring search, but am not sure what the syntax might be.
The survey is for plant species, and I would like to pop up a warning if the user records a plant that is not within it's known range (list of counties). My thought is that I can have the user select the county they are in, and then use that response to search for a match in the range list. I think the structure might be something like: selected(${County}) %in% Range, but I don't know how to go about a substring search in Survey123 syntax.
type | name | label |
text | example | Example |
select_one county | County | County |
begin repeat | plantList | Species |
select_one species | species | Select Species: |
note | outside known county | |
end repeat |
Survey Tab
example of species data from choices tab
list_name | name | label | Range |
species | Pseudelymus_saxicola | Pseudelymus saxicola | Beaver, Box Elder, Cache, Carbon, Daggett, Davis, Duchesne, Emery |
species | Abies_sp. | Abies sp. | Cache |
species | Achnatherum_parishii | Achnatherum parishii | Carbon, Dag |
Hi Miles
Have you considered using cascading selects?
This way you could use the county as a choice filter on the species list, and the user would only be able to select a species that exists within the county they selected.
This would work if you were not to use ranges, but instead break them up into counties. You would need to have a record in the choice list for each species in each individual county:
list_name | name | label | County |
species species | Pseudelymus_saxicola Pseudelymus_saxicola | Pseudelymus saxicola Pseudelymus saxicola | Beaver Box Elder |
How many species and ranges are we talking about here - is this possible?
There is a sample for cascading selects in Connect and the help is here: Cascading and external selects—Survey123 for ArcGIS | ArcGIS
Thanks
John
Jonathan -
Thanks for the help! I was hoping to have an entire state's worth of species in the list (~4,000 species), and thought that having each county list would be to large, but I've limited the species list to a limited number of counties within the work area, and the cascading select to get a county species list is a great approach.
Another approach I've come up with is to avoid the county species lists, and load one list of the entire state species list into the external choices and link it to a question in the choices tab to enable autocomplete search for species. To supply additional relevant info that I want to see but don't need to edit (i.e- which counties it's known from, it's nativity, and state sensitivity) I've put this info into a .csv in the media folder and used a combination of calculate question and pulldata, and note questions to pop up a species nativity, sensitivity, and known locations after selecting it. It is nice to have the entire list as there are some species that are known to occur in the state, but do not have any county records listed in the USDA plants list (yet).