Condition on random number not working properly

Hi fellow ODK users,

A form I programmed which is currently being used for data collection is experiencing a problem for which I cannot find an explanation.

The form is divided into sections, and only one between sections 2 and 3 is relevant depending on certain conditions. Those conditions are the following:

  • Respondents must answer 'Yes' to: Are you willing to participate in this study? (question m1_q1)
  • Respondents are then asked if they are directors/heads of unit (question iv_a). If they are, they always take section 2.
  • If respondents are not directors/heads of unit, a random number is generated (iv_b). If the number is lower than 0.5, they take section 2. Otherwise, they go to section 3.

These conditions have been set with the following relevance coding: (note that for m1_q1 and iv_a, yes=1 and no=2)

For section 2: ${m1_q1}!=2 and (${iv_a}=1 or (${iv_a}=2 and ${iv_b}<0.5))
For section 3: ${m1_q1}!=2 and (${iv_a}=2 and ${iv_b}>=0.5)

My problem is that there have been 2 cases (from almost 1,800 submissions) in which the form has neither shown section 2 nor section 3. In these two cases, the form should have shown section 2. These are the values these 2 cases got:



A very strange additional detail about these two cases is that these random numbers are the lowest ones among all the 1,800 submissions
We are using SurveyCTO Collect v2.41 and our devices are Acer Iconia tablets.

Have any of you ran into a similar issue before?

Thanks very much in advance.


HI @luise, can you share a sample form to show how you use the random number


@luise, SurveyCTO Collect and ODK Collect are not the same applications and they can have very different behavior. Further, SurveyCTO is closed-source so I have no idea how they implement random(). Please contact the SurveyCTO support at for help.