In Survey123, the if function follows the syntax
if(condition, return if true, return if false)
So, for the example expression you give, you'd need to write this out as follows (I'll use line breaks to make this clearer):
if(
${hospital} == 'Facility1' or ${hospital} == 'Facility2',
'Region 1',
if(
$[hospital} == 'Facility3' or ${hospital} == 'Facility4' or ${hospital} == 'Facility5',
Region 2',
''
)
)
You'll need that all in one line for it to work properly, but note how multiple conditions have to be specified clearly. It feels linguistically sensible to say "${hospital} = 'A' or 'B', but programmatically, your survey is going to treat 'B' as its own condition.
For a large number of potential hospitals and regions, this can make for a large expression, but at least you'll only need to write it once.
- Josh Carlson
Kendall County GIS