We are trying to create a survey in Survey123 Connect where a score is assigned based on user choice for a select_one type question in an integer type following the question. The issue we are having is that we are only to generate scores for 2 of the questions depending on the calculation formatting. See screenshots below as well as the calculation used in the integer type. Any suggestions would be greatly appreciated
if(${a2o_1}="yes",${c2},${c1}) or if(${a2o_1}="yhi",${c3},${c1}) or if(${a2o_1}='no',${c1},${c1})
Solved! Go to Solution.
You cannot use or inbetween if statements like that. You need to use the else in the if. Looking at your options I think this would work and be simpler.
if(${a2o_1}="yes",${c2}, if(${a2o_1}="yhi", ${c3}, ${c1}))
This assumes it will never be blank.
Hope that helps
You cannot use or inbetween if statements like that. You need to use the else in the if. Looking at your options I think this would work and be simpler.
if(${a2o_1}="yes",${c2}, if(${a2o_1}="yhi", ${c3}, ${c1}))
This assumes it will never be blank.
Hope that helps
That did the trick, thanks Doug!
so, if I wanted to sum the results from multiple questions, what would be the proper syntax for that?
ex
${a2o_1}+${a2o_2}...
Yes typically that is what I do. One line for each sum then one master that sums them all up. Set the bind type field to int so you get a number and not a string. Can also set the temp fields bind esri type to null and they will stay out of the feature service.
hmm, I must be doing something wrong. Getting an empty output with the following. Same empty output with parenthesis around the calculation
Are those 3 fields set to bind int?
I believe so, yes
Yes that looks right. At this point just post the form or just guessing.