How to refer to answers from a previous question in a later question?

I would like to refer to an answer (but the LABEL not the NAME of this
answer) from a previous question in a later question.

I am using XLS to write out my survey.

E.g. For the below question, if the answer to the first question is "bread"
I would like the second question to read on the phone as "Did the household
have bread available all year long?" But right now it is showing up as
"Did the household have 1 available all year long?"

"survey" tab
type name label
select_one staple staple1 What is the
household's main staple food?
select_one yesno staple_yesno Did the household have
${staple1} available all year long?

"choices" tab
type name label
staple 1 bread
staple 2 rice

You can do a number of things along these lines, but it probably requires
modifying the XML directly.

Clayton described an itext inverse-label display technique on this thread (
http://groups.google.com/group/opendatakit/browse_thread/thread/c44f26680ac866ce/c64809383e3a3146).

The selected 'value' is concatenated with a prefix string to construct an
itext entry that holds the label for that value; the string is then
retrieved via a jr:itext() call (which can be used within calculate
expressions).

I created a more sophisticated example of a table lookup here:
http://www.cs.washington.edu/homes/msundt/lookup/

Mitch

ยทยทยท On Sat, Feb 9, 2013 at 1:17 PM, Sam wrote:

I would like to refer to an answer (but the LABEL not the NAME of this
answer) from a previous question in a later question.

I am using XLS to write out my survey.

E.g. For the below question, if the answer to the first question is
"bread" I would like the second question to read on the phone as "Did the
household have bread available all year long?" But right now it is
showing up as "Did the household have 1 available all year long?"

"survey" tab
type name label
select_one staple staple1 What is the
household's main staple food?
select_one yesno staple_yesno Did the household have
${staple1} available all year long?

"choices" tab
type name label
staple 1 bread
staple 2 rice

--

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