Primary Key value for a form question

Hi All;
I am doing a data collection exercise using ODK Collect 1.2.1, with a
questionnaire created in ODK Build and edited using notepad++. I want to
have a unique value for a variable in the questionnaire called
"couponNumber". That is if a research assistant enters the coupon number,
he or she cant duplicate or enter the value again in another form. The
coupon number should be unique for each entry per questionaire.

There is no way to do this with a form.

If you want to code something up, one approach is to add an attribute
to the bind. Then when you process the form, you build a backing
SQLite database for that attribute.

Then on swipe at that prompt, you store that node path and value. The
tricky part is how to prevent a user from entering that value. You
won't be able to use JavaRosa's constraints easily, so you have to
modify each text-based prompt type to prevent swipe if that node path
and value is found in the database.

Note that this won't work across devices unless you do some
multi-device (or client/server) sync magic. Also, if you uninstall
Collect, those databases will go away.

http://opendatakit.org/help/help-for-hire/ has a list of companies
that will be able to build this.

ยทยทยท On Mon, Dec 3, 2012 at 8:07 AM, Keniajin Wambui wrote: > Hi All; > I am doing a data collection exercise using ODK Collect 1.2.1, with a > questionnaire created in ODK Build and edited using notepad++. I want to > have a unique value for a variable in the questionnaire called > "couponNumber". That is if a research assistant enters the coupon number, he > or she cant duplicate or enter the value again in another form. The coupon > number should be unique for each entry per questionaire.