The form has three main Scenarios(options), but the user can select “YES” for only one Scenarios(option).
In each scenario, I need to show a number in the “Monthly Expense” field, which will be randomly picked from a list of numbers like “300 500 800 1000 1200 1500 2000 2500 3000 5000”.
To achieve this, I have used a calculate function: selected-at(${values}, int(random() * count-selected(${values}))).
This works fine in the Desktop Web Browser, but it does not work in the KoboCollect Mobile App.
As a new user I cannot upload the XLS file so below is the detail from the XLS file:-
type name label required default relevant calculation read_only
text | values | values | false | 300 500 800 1000 1200 1500 2000 2500 3000 5000 | false | ||
---|---|---|---|---|---|---|---|
calculate | randomvalue | false | selected-at(${values}, int(random()*count-selected(${values}))) | ||||
text | S1C1EX1 | Monthly Expense | false | once(${randomvalue}) | true |
Hope this will help to understand.
Please review and let me know your suggestion.