Relevance with integers

Hello,

I am trying to do the following:

Question 1a is an integer question where you put 96 in case the answer is 'Other'
In order to write the text out for other, I want to create a question 1b that will only show up if someone put in 96 as the number in the 1a.

When I put in selected(${1a},'96') in the relevant column for 1b, I get an error when I am filling out the form on the tablet.

I know I can do this when I have multiple choice options, but what about with integers?

Thanks!
Shreya

Shreya,

selected() only works with select options. Try "${1a} = 96" instead.

http://opendatakit.org/help/form-design/binding/ has other bindings
that you can try.

Yaw

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

On Tue, Aug 12, 2014 at 1:00 PM, Shreya Agrawal sagrawal@clintonhealthaccess.org wrote:

Hello,

I am trying to do the following:

Question 1a is an integer question where you put 96 in case the answer is
‘Other’

In order to write the text out for other, I want to create a question 1b
that will only show up if someone put in 96 as the number in the 1a.

When I put in selected(${1a},'96') in the relevant column for 1b, I get an
error when I am filling out the form on the tablet.

I know I can do this when I have multiple choice options, but what about
with integers?

Thanks!

Shreya

--

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.

Two things:

(1) field names should begin with a letter, not a number. I.e., '1a' is a
bad field name -- perhaps use 'q1a' instead. ODK Collect and XLSForm are
relaxed about these names, but XML requires name tags to begin with a
letter. This can cause problems in some downstream processing, or, at the
very least, requires the software to prefix these field names with an 'n'
to make them conform to the XML naming requirements.

(2) if you are using a select-one or select-multiple, keep in mind that the
values are strings, not numbers. So if you write 96, the software is
actually using the string value '96'.

So (again, if you are using a select prompt and not a data-entry field),
you should write the selected() function as:

selected(${q1a},'96')

If you need to convert these string values to numbers, you can use the
int() function. i.e., int(${q1a})

··· On Tue, Aug 12, 2014 at 2:00 PM, Yaw Anokwa wrote:

Shreya,

selected() only works with select options. Try "${1a} = 96" instead.

http://opendatakit.org/help/form-design/binding/ has other bindings
that you can try.

Yaw

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

On Tue, Aug 12, 2014 at 1:00 PM, Shreya Agrawal sagrawal@clintonhealthaccess.org wrote:

Hello,

I am trying to do the following:

Question 1a is an integer question where you put 96 in case the answer is
‘Other’

In order to write the text out for other, I want to create a question 1b
that will only show up if someone put in 96 as the number in the 1a.

When I put in selected(${1a},'96') in the relevant column for 1b, I get
an
error when I am filling out the form on the tablet.

I know I can do this when I have multiple choice options, but what about
with integers?

Thanks!

Shreya

--

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