Leading zeros and restricting dates

Hi!
I am trying to give participants individual id numbers and need to keep the
leading zeros. I use a string command with a regex restriction to 3 digits
and have the appearance as numbers. However, when i look at the data
collects in excel, the leading zeros are dropped. Does anyone know how to
keep the leading zeros? I have looked at older threads on this and still
cannot figure it out.

Also, is there a way to restrict date questions? I am asking for birth
dates and interview dates. I want to restrict birth dates to be less than
the interview date so that when age is calculated there are no negative
ages. Any help on either of these issues would be greatly appreciated! I am
using the XLS form to make my surveys.
Cheers,
Sarah

Sarah,

The first issue you describe is an Excel problem. Try a manual import
and import that column as text, and not a number. Alternatively, have
a hidden calculate prompt that takes the ID prompt and prepends a
special character like X.
calculate: concat('X', /data/id)

Examples from http://opendatakit.org/help/form-design/binding/ are
useful to figure out constraints.

answer must be after /widgets/date

constraint=". >= /widgets/date"

answer must be after today

constraint=". >= today()"

Yaw

ยทยทยท -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Mon, Nov 18, 2013 at 10:53 AM, Sarah Pfeil skpfeil@gmail.com wrote:

Hi!
I am trying to give participants individual id numbers and need to keep the
leading zeros. I use a string command with a regex restriction to 3 digits
and have the appearance as numbers. However, when i look at the data
collects in excel, the leading zeros are dropped. Does anyone know how to
keep the leading zeros? I have looked at older threads on this and still
cannot figure it out.

Also, is there a way to restrict date questions? I am asking for birth dates
and interview dates. I want to restrict birth dates to be less than the
interview date so that when age is calculated there are no negative ages.
Any help on either of these issues would be greatly appreciated! I am using
the XLS form to make my surveys.
Cheers,
Sarah

--

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/groups/opt_out.