AnsweredAssumed Answered

Syntax to search substring for selected(question,value)

Question asked by MilesMcCoySulentic on Apr 11, 2018
Latest reply on Apr 20, 2018 by MilesMcCoySulentic

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.



select_one countyCountyCounty
begin repeatplantListSpecies
select_one speciesspeciesSelect Species:
noteoutside known county
end repeat

Survey Tab

example of species data from choices tab

speciesPseudelymus_saxicolaPseudelymus saxicolaBeaver, Box Elder, Cache, Carbon, Daggett, Davis, Duchesne, Emery
speciesAbies_sp.Abies sp.Cache
speciesAchnatherum_parishiiAchnatherum parishiiCarbon, Dag