Hi am trying to use a score obtained to preselect a single choice question basing on the score the respondent has scored as shown in
how do I preselect say 2 for an individual who qualifies to be in LSM group 2
aG4B842NdgpvMXwajY8jbU (2).xlsx (12.1 KB)
wroos
May 27, 2023, 11:27am
2
You can use a calculation to pre-set a value, e.g. once( if( ${YourScoreVar} = aValue, “choiceName”, “” ). Without once, the select cannot be edited.
Also a trigger construct would be an option.
1 Like
Hi @wroos , I didn’t understand, Can I use several If statements under the same calculation column of the single select question? as indicated in this image
it seems like I need several if statements
Is there a way I can use an if else, I have reduced the answer options to the preselection question to 3 that is DE, C1C2, B as shown
Am now able to preselect the first 2 options but unable to cater for the 3 as shown by the link Enketo Express for KoboToolbox
Hi @alexiga , yes you can use the if-else sentences. here the similar topic to yours
koboform.xlsx (9.8 KB)
the comment is not part of the form, I just inserted it there to explain what I want
1 Like
Hi @osmanburcu , how is the else-if used
wroos
May 27, 2023, 5:17pm
7
1 Like
@alexiga , here is a similar post discussed previously that should solve your issue:
@tasfik_rukan , you could do the same as outlined in the image shared below:
In the survey tab of your xlsform:
[Image 1]
In the choices tab of your xlsform:
[Image 2]
Data entry screen as seen in Enketo: Slight
[Image 3]
Data entry screen as seen in Enketo: Moderate
[Image 4]
Data entry screen as seen in Enketo: Extreme
[Image 5]
Reference xlsform:
Counting Response.xlsx (11.0 KB)
And this post discussed previously should also be helpful:
@ngolahdata21 , we do have some workarounds in the community (discussed previously) that should solve your query.
This post should solve your first query:
This post should solve your second query:
This post should solve your third query:
Thanks @Kal_Lam ,
Was able to solve this as in link Enketo Express for KoboToolbox but it does not preselect using android app, How do I go about this?
1 Like
wroos
May 28, 2023, 10:41am
10
Could you share the related part of your XLSForm here, please.
Testing your link:
I get score 32 if nothing is selected
I get nothing preselected initially, but after entering a score and removing it afterwards, I get still the last SEC preset.
I can manually change/set the score and the SEC (should be read_only).
I can enter extremely high scores (resulting in DE selected).
With the spinner I can even enter negative scores. (This seems to create an error msg, quickly disappearing, and also results in “DE” selected.)
It seems that your score field has a decimal type.
The maximum summed score if I select all items is 565, but I can enter bigger numbers.
If I enter 12345678901234567, the spinner stops working correctly with the last (17th) digit. (@Kal_Lam )
Is this ok?
Would you mind, to check and preview/test your form also with the online validator , please?
1 Like