[XLS Help] Piping Names and Phone Number Constraint

Pratibha.

You should be able to enter more than 4 digits, but if you do and try
to swipe, there should be an constraint message that shows up. There
is no way to restrict the input box itself to 4 digits. File a feature
request or hire a developer if you want to have that feature.

If you aren't getting the constraint message, then try making prompt a
string with appearance "numbers". The form XML will look like this.

bind:
body:

Yaw

··· -- Need ODK help? Go to http://nafundi.com for custom features, form design, implementation support, and user training for ODK.

On Tue, May 21, 2013 at 5:38 AM, pratibha shrestha pratzstha@gmail.com wrote:

Hi Yaw and Mitch,

I'm trying to constraints on the length of an integer field and both
regex(.,'[A-Za-z0-9]{4}') and regex(.,'[1]{4}$'), allow inputs more
than 4 digits. Can you please let me know how I can restrict the length to
exactly 4 digits?

Thanks,
Pratibha

On Thursday, January 31, 2013 1:38:47 AM UTC+5:30, Audrey Henkels wrote:

Works perfectly now. Thanks for the help!

Best,
Audrey

On Wed, Jan 30, 2013 at 10:53 PM, Yaw Anokwa yan...@nafundi.com wrote:

First, make the question required. Second, add the start/end
characters (^ and $)

Final XML should look like...

On Wed, Jan 30, 2013 at 11:09 AM, Audrey Henkels audrey....@gmail.com wrote:

Hi Yaw,

Thanks for the speedy response. I made the change, and unfortunately,
now it
doesn't seem to restrict the number of digits on input.

Here is the constraint I used, in xls forms. Can you please confirm
that I
have the correct formatting?

regex(.,'[A-Za-z0-9]{2}')

Thanks so much.

Best,
Audrey

On Wed, Jan 30, 2013 at 9:31 PM, Yaw Anokwa yan...@nafundi.com wrote:

The example I used was just uppercase. Try [A-Za-z0-9]{4} if you want
to include lower case.

On Wed, Jan 30, 2013 at 10:28 AM, audrey....@gmail.com wrote:

Hi Yaw,

I have a question about the regex constraint you mention below. I
tested
this out (as a constraint in xls forms) and found that it restricts
the
number of digits correctly but only allows input that begins with
letters.
I'd like to be able to restrict to alphanumeric input, regardless of
whether
it begins with numbers or letters. Is this possible? Can you please
advise
as to the constraint that would accomplish that.

Thanks so much for your help.

Best,
Audrey

On Friday, September 14, 2012 5:31:21 PM UTC+3, Yaw Anokwa wrote:

Michael

Both of these are somewhat advanced operations.

For the first, you need to add something like this for the prompt
label. So if you wanted to ask someone their age, you'd put this:
"Hello, . What is your age?"

For the second, you need a regular expression constraint (read
http://www.regular-expressions.info/ for more). For example, this
constraint will allow only alphanumeric input that is 4 characters
long.
regex(.,'[A-Z0-9]{4}')

Hope this helps,

Yaw

On Fri, Sep 14, 2012 at 10:21 AM, m_optimal mmana...@optimalsolutionsgroup.com wrote:

Hi ODK Community,

I'd like to know if there is an xls syntax for piping the
respondent's
Name
(ex. Matt), such that when the next question comes up (ex. What
is
[NAME's]
gender?), the [NAME's] automatically changes to the respondent's
actual
Name
(ex. What is Matt's gender?).

Secondly, I need some help with constraining the phone number
such
that
the
enumerator is required to entering a phone number that is between
7-10
characters (integers) long, with the country code as the required
integers
for the first three characters. Is there a way to accomplish that
in
xls?

Thank you for the help!

Michael

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

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

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.


  1. A-Za-z0-9 ↩︎

The preceding examples were for strings; If the value is an integer, you
should have a constraint like this:

constraint=". >= 0 and . <= 9999"

(for positive values 0 - 9999).

··· On Tue, May 21, 2013 at 8:25 AM, Yaw Anokwa wrote:

Pratibha.

You should be able to enter more than 4 digits, but if you do and try
to swipe, there should be an constraint message that shows up. There
is no way to restrict the input box itself to 4 digits. File a feature
request or hire a developer if you want to have that feature.

If you aren't getting the constraint message, then try making prompt a
string with appearance "numbers". The form XML will look like this.

bind:
body:

Yaw

Need ODK help? Go to http://nafundi.com for custom features, form
design, implementation support, and user training for ODK.

On Tue, May 21, 2013 at 5:38 AM, pratibha shrestha pratzstha@gmail.com wrote:

Hi Yaw and Mitch,

I'm trying to constraints on the length of an integer field and both
regex(.,'[A-Za-z0-9]{4}') and regex(.,'[1]{4}$'), allow inputs
more
than 4 digits. Can you please let me know how I can restrict the length
to
exactly 4 digits?

Thanks,
Pratibha

On Thursday, January 31, 2013 1:38:47 AM UTC+5:30, Audrey Henkels wrote:

Works perfectly now. Thanks for the help!

Best,
Audrey

On Wed, Jan 30, 2013 at 10:53 PM, Yaw Anokwa yan...@nafundi.com wrote:

First, make the question required. Second, add the start/end
characters (^ and $)

Final XML should look like...

On Wed, Jan 30, 2013 at 11:09 AM, Audrey Henkels audrey....@gmail.com wrote:

Hi Yaw,

Thanks for the speedy response. I made the change, and unfortunately,
now it
doesn't seem to restrict the number of digits on input.

Here is the constraint I used, in xls forms. Can you please confirm
that I
have the correct formatting?

regex(.,'[A-Za-z0-9]{2}')

Thanks so much.

Best,
Audrey

On Wed, Jan 30, 2013 at 9:31 PM, Yaw Anokwa yan...@nafundi.com wrote:

The example I used was just uppercase. Try [A-Za-z0-9]{4} if you
want
to include lower case.

On Wed, Jan 30, 2013 at 10:28 AM, audrey....@gmail.com wrote:

Hi Yaw,

I have a question about the regex constraint you mention below. I
tested
this out (as a constraint in xls forms) and found that it
restricts
the
number of digits correctly but only allows input that begins with
letters.
I'd like to be able to restrict to alphanumeric input, regardless
of
whether
it begins with numbers or letters. Is this possible? Can you
please
advise
as to the constraint that would accomplish that.

Thanks so much for your help.

Best,
Audrey

On Friday, September 14, 2012 5:31:21 PM UTC+3, Yaw Anokwa wrote:

Michael

Both of these are somewhat advanced operations.

For the first, you need to add something like this for the prompt
label. So if you wanted to ask someone their age, you'd put this:
"Hello, . What is your age?"

For the second, you need a regular expression constraint (read
http://www.regular-expressions.info/ for more). For example,
this
constraint will allow only alphanumeric input that is 4
characters
long.
regex(.,'[A-Z0-9]{4}')

Hope this helps,

Yaw

On Fri, Sep 14, 2012 at 10:21 AM, m_optimal mmana...@optimalsolutionsgroup.com wrote:

Hi ODK Community,

I'd like to know if there is an xls syntax for piping the
respondent's
Name
(ex. Matt), such that when the next question comes up (ex. What
is
[NAME's]
gender?), the [NAME's] automatically changes to the
respondent's
actual
Name
(ex. What is Matt's gender?).

Secondly, I need some help with constraining the phone number
such
that
the
enumerator is required to entering a phone number that is
between
7-10
characters (integers) long, with the country code as the
required
integers
for the first three characters. Is there a way to accomplish
that
in
xls?

Thank you for the help!

Michael

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

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--

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.

--

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.

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


  1. A-Za-z0-9 ↩︎