Hi there,
I'm trying to use conditional if / then / else logic in Survey123 to take a range of numeric values calculated in (question_one) and assign it a value accordingly.
I've tried modifying this script (from: https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION2_BED1A394912441F3833B6D15DE3D6FB5😞
if(condition, a, b) | If the condition evaluates to true, returns a; otherwise, returns b. | if(selected(${question_one}, 'yes') and selected(${question_two}, 'yes'), 'yes', 'no') |
The conditional logic would be something like:
if(${question_one} > 1.0 and < 1.9) then assigned_value = '500mm'
if(${question_one} > 2.0 and < 2.9) then assigned_value = '600mm'
else(${question_one} > 2.0 and < 2.9) then assigned_value = '700mm'
I've tried this format (and similar variations):
if(${Q100} > 0.5), '500'
Note: question_one is a numeric field (decimal) that calculates a total based on other fields in the form (i.e. an average). The assigned_value field would then use that auto-calculated numeric value field and categorize the numeric values based on ranges (i.e. 1.0 to 2.9 or >= 1 and <= 2.9).
Is this possible within Survey123. Does anyone have experience using a similar loop conditional statement?
Thanks in advance for your help!
SJ