Queries about Unique numbers for ODK-submitted forms and constraint functions

Hello all, thank you, ODK team for the outstanding support, sorry my English is not so good, and I need to know
A. how to create a Unique number for ODK-submitted forms
B. Is the constraint function used only for numerical value or we can use it for multi answers choices (if answers in Q1 are ( A or B or C or D) Then q10 should be x)

Welcome elfaki!

Random numbers can be generated using the following function: Once(Random())
The result will be a random number between 0 and 1. You can then multiply this number if you want a larger number and round it in order to remove remaining decimals.

For you second question, yes constraints can be applied to any type of question. The constraint for your example would be as follows: ${q10} = 'x'

1 Like

Thanks, a lot for support