Function not working in KoboCollect Mobile App

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.

Welcome to the community, @munirul! You should be able to upload your XLSForm to the community now.

Here is the XLS file

ChildCare Survey Mitra -V4.xlsx (7.9 KB)

This works fine in the Desktop Web Browser, but the calculate function: selected-at(${values}, int(random() * count-selected(${values}))). does not work in the KoboCollect Mobile App.

I have uploaded the XLS file @Kal_Lam . Please review and let me know your suggestion.

Please review and let me know your suggestion.