Random Number Generator

I would like to have questions in the survey conditional on a random number. As many have mentioned the rand() function is volatile such that it re-generates any time the survey is opened. Does anyone has a solution to this besides once(rand())? I am finding the once command unstable.

Hi EZ,

What do you mean by unstable? What version of ODK Collect are you
using? Do you have a short one or two question form that shows the
issue?

Yaw

··· On Tue, Sep 20, 2016 at 10:50 AM, EZ wrote: > I would like to have questions in the survey conditional on a random number. As many have mentioned the rand() function is volatile such that it re-generates any time the survey is opened. Does anyone has a solution to this besides once(rand())? I am finding the once command unstable. > > -- > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to the Google Groups "ODK Community" group. > To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

And note that once() should not be embedded within a formula.

create a calculated field with a formula once(...rand()...)

Then reference that field value elsewhere in the form.

··· On Thu, Sep 22, 2016 at 7:48 AM, Yaw Anokwa wrote:

Hi EZ,

What do you mean by unstable? What version of ODK Collect are you
using? Do you have a short one or two question form that shows the
issue?

Yaw

On Tue, Sep 20, 2016 at 10:50 AM, EZ evazleid@gmail.com wrote:

I would like to have questions in the survey conditional on a random
number. As many have mentioned the rand() function is volatile such that it
re-generates any time the survey is opened. Does anyone has a solution to
this besides once(rand())? I am finding the once command unstable.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google
Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com