Assigning Values to Choices for Select_Multiple Questions

2197
5
Jump to solution
02-02-2022 06:26 PM
JasmineSnowsill
New Contributor II

I am working on connect, attempting to create a survey to be used for entering stream health data / variables of which many are to be given a score depending on the level of quality they indicate.
Thus far I have been able to give values to 'select_one' choices by naming the choices the value that coincides with that choice (as shown below). 

JasmineSnowsill_0-1643852159831.png

JasmineSnowsill_1-1643852535950.png

I have tried to use this method (above) for the select multiple questions but it did not produce any 'score'

I have also tried the method (below) with ‘if’ statements such as “if(selected(${TrueFlies},Mosquito),3,0)”.
I thought this would equate to if mosquito is selected from the list of true flies then give it a score of 3, if this is false (meaning it is not selected) then value it at 0. However I think this function is possibly not for this type of use.
No score was automatically calculated in the row where I attempted to add all the values and divide it by the number of choices that were actually selected. It's very likely that I am using the wrong methods but I couldn't find anything else that may work.

JasmineSnowsill_2-1643852692954.pngJasmineSnowsill_3-1643852727242.png

I am rather new to using survey123 and survey123 connect so I hope my question and aim makes sense.

Thanks

0 Kudos
2 Solutions

Accepted Solutions
SayedWali
New Contributor III

Hi @JasmineSnowsill 

what I have noticed if(selected(${TrueFlies},Mosquito),3,0) is not correct. Please put the Mosquito inside single quotes as this: if(selected(${TrueFlies},'Mosquito'),3,0) and follow this with all other strings in your calculations.

To answer the rest of your questions, could you upload your XLS file to evaluate the questions?

 

View solution in original post

SayedWali
New Contributor III

Hi @JasmineSnowsill 

sorry for late as it's busy days for me. 

I have modified little bit your XLS form and set int for the bind and changed esri bind into decimal for InvertScore then changed the type to Calculate. Also created another field name Invertebrate Scores to Round the total Score.

Have the attachment and the screenshot

Seems to be working!

CheersStream Health M form.jpg

View solution in original post

5 Replies
SayedWali
New Contributor III

Hi @JasmineSnowsill 

what I have noticed if(selected(${TrueFlies},Mosquito),3,0) is not correct. Please put the Mosquito inside single quotes as this: if(selected(${TrueFlies},'Mosquito'),3,0) and follow this with all other strings in your calculations.

To answer the rest of your questions, could you upload your XLS file to evaluate the questions?

 

JasmineSnowsill
New Contributor II

Hi @SayedWali 

Thank you, I updated my strings and that has helped as it is now showing me an output. Unfortunately the output should be a number between 1 and 10, so something is definitely wrong in my calculations (see below).

JasmineSnowsill_0-1643923963017.png

I have attached my XLS file.

Thanks for your help 🙂

0 Kudos
SayedWali
New Contributor III

Hi @JasmineSnowsill 

sorry for late as it's busy days for me. 

I have modified little bit your XLS form and set int for the bind and changed esri bind into decimal for InvertScore then changed the type to Calculate. Also created another field name Invertebrate Scores to Round the total Score.

Have the attachment and the screenshot

Seems to be working!

CheersStream Health M form.jpg

JasmineSnowsill
New Contributor II

Hi @SayedWali 

No worries.

Thank-you for your explanation and help, I really appreciate it!

Cheers 🙂 

JeetzPatel
New Contributor II

Thanks both for this workflow, I needed to do something similar for one of my projects and it's worked perfectly! I stuck the round into the calculate for the overall score which is the only difference I had.