I have a simple question regarding a survey123 connect I am building, specifically a 'select_multiple' option.
If field staff catch a fish, they will search through a species list.
I want to provide a filter for "other" and "salmonid". This part is simple.
In the relevant column, I am using the following.
for salmonids I am using ${fish_type}=’salmonid’ and for other I am using ${fish_type}=’other’. This works great, no problems.
Occasionally, staff will document multiple fish, possibly one from each filter. In this case, I would like staff to be able to select both the 'other' filter and the 'salmonid' filter.
I have been trying different combinations but failing each time. I expect it should look something like this?
${fish_type}=’salmonid’ or ${fish_type}= (’salmonid’ and 'other')
If anyone has suggestions it would be much appreciated.
Thank you
Have you tried contains?
contains(string, substring)
Returns true if the given string contains the substring.
contains(${question_one}, 'red')
Thank you Doug,
Thank you Doug! I tried the following and it works great.
contains(${fish_type}, 'salmonid' or (’salmonid’ and 'other'))
I think this is the correct syntax though.
contains(${fish_type}, 'salmonid') or contains(${fish_type}, 'other')
Why not selected()? It is intended to be used with select_multiple for this purpose.
selected(${fish_type}, 'salmonid')
EDIT: I will add that contains() does work in places that selected() doesn't, such as a WHERE clause for an Inbox survey. But in this particular case, I'd go with selected() as the standard for ALL select_one and select_multiple.
Oh yea duh this is for a relevant. So yea that is the better way really.