Hello,
I would like to make groups in my Survey123 form relevant depending on the response to another question.
The question is which protocol the end user is using: Crown Health, Biocontrol, or Both.
If they select Both, I would like both groups (Crown Health and Biocontrol) to be visible/relevant. Is they select Crown Health, I would like to make only the Crown Health group relevant/visible. Is they select Biocontrol, I would like to make only the Biocontrol group relevant/visible.
I have tried the following in the group relevancy for the Crown Health group:
${Protocol} !='Biocontrol'
${Protocol} ='Both' OR ${Protocol} ='CrownHealth'
${Protocol} ='Both' OR 'CrownHealth'
${Protocol} ='Both' , 'CrownHealth'
None have worked, can anyone help out with this one?
Thanks,
Solved! Go to Solution.
The statement
${Protocol} = 'CrownHealth' or ${Protocol} = 'Both'
works for me. Note the lower-case 'or'.
The statement
${Protocol} = 'CrownHealth' or ${Protocol} = 'Both'
works for me. Note the lower-case 'or'.
Perfect! Thank you. I didn't know it was case- sensitive. Thanks for your rapid response.
As opposed to the "question=value" formula pattern, you probably want to use the "selected(question, value)" function - Relevant expressions—Survey123 for ArcGIS | ArcGIS
Yep that did the trick... I hadn't seen that bit of info.
Thanks James...
Jason##
How would I approach a "Select_one" where I need to assign a numerical value to each choice so that a calculation can be made against the selection? I would assume that this must be simple... but the proper syntax is just escaping me for the calculation. Any thoughts?
list_name | name | label | value |
---|---|---|---|
holesize | holesize1 | 1/4 inch | 2.5 |
holesize | holesize2 | 3/16 inch | 3.5 |
holesize | holesize3 | 5/32 inch | 4.5 |
type | name | label | calculation |
---|---|---|---|
select_one holesize | holesize_calc | Hole size calculation | (????) * (1.3) |
A few issues probably are tripping you up:
1) In your list, the 'name' column should contain the values you are going to use in the calculation
2) The calculation should be in a second question, either decimal, calculate, or note (decimal gives the opportunity for user input if the calculation is only a reasonable default that can be corrected, calculate will store the answer without the user seeing, note provides a read-only reference to the user).
To take your tables above:
list_name | name | label |
---|---|---|
holesize | 2.5 | 1/4 inch |
holesize | 3.5 | 3/16 inch |
holesize | 4.5 | 5/32 inch |
type | name | label | calculation |
---|---|---|---|
select_one holesize | target_size | Target diameter | |
decimal | holesize_calc | Hole Size calculation | ${target_size}*1.3 |
Yep that worked perfectly.. having the value in the name field was this issue. what was tripping me up was that in the survey tab for name it forces strings. I didn't realize it would be different for choices. Makes total sense now.
Thanks again James... you've been a huge help.
Jason
new to survey123 and not sure if this is the right place for this question, but I want to pop up a warning note if a species is observed outside of it's known range, based on county. I am using a cascade select and a repeat question to record all species found at a site. My species data also has a column with a comma-separated list of counties where it is known to occur. I was thinking that I could use a relevant statement for a note that would occur only when the survey location county string is not found in the list of "Range" counties for each species, but I'm struggling to piece it together.
Thanks
Survey Tab
type | name | label |
text | example | Example |
select_one county | county | County |
begin repeat | plantList | Species |
select_one species | species | Select Species: |
end repeat | ||
note | outside known range |
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, Daggett, Davis |