Skip logic referring to question in a repeat group

Say a question's skip logic refers to a prior question that is part of a
repeat group. Which 'instance' of the question does the logic get computed
on? The last one? The first one? Neither? Is this not allowed? Please
advise. Thanks.

··· -- Tom Smyth Worker-Owner, Sassafras Tech Collective Specializing in innovative, usable tech for social change sassafrastech.com

XLSForm doesn't generate the appropriate reference for working within
repeat groups. If you want to refer to a value from the same instance of
the repeat group, you can use ../fieldname instead of ${fieldname} in the
XLS file. Unfortunately, XLSForm expands everything out to an absolute
reference ( /formname/repeatgrp/fieldname ) and that absolute reference,
when working with the 2nd instance of a repeat group, expands to a set of 2
values, causing everything to break.

With ODK Collect 1.4, you can also use the indexed-repeat(...) accessor to
reference values from prior repeat instances.

Mitch

··· On Wed, Sep 25, 2013 at 12:25 PM, Thomas Smyth wrote:

Say a question's skip logic refers to a prior question that is part of a
repeat group. Which 'instance' of the question does the logic get computed
on? The last one? The first one? Neither? Is this not allowed? Please
advise. Thanks.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--

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

Reviving this ancient question. Anyone thought of an answer yet :stuck_out_tongue:

··· On Wed, Sep 25, 2013 at 3:25 PM, Thomas Smyth wrote:

Say a question's skip logic refers to a prior question that is part of a
repeat group. Which 'instance' of the question does the logic get computed
on? The last one? The first one? Neither? Is this not allowed? Please
advise. Thanks.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
Tom Smyth

Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafras.coop · @sassafrastech

Resident, Touchstone Cohousing
touchstonecohousing.org

In JavaRosa, as implemented in Collect, references outside the repeat group
refer to ALL instances... so functions like join() or sum() work well.
Other functions or operators, which operate on one value at a time
(like +), will fail with an error. In recent versions of Collect, that
error will suggest that you use the indexed-repeat() function to specify
which instance you want. indexed-repeat() allows you to pass the entire set
of responses and which you want, and it returns that one.

Best,

Chris

··· --- Christopher Robert Dobility, Inc. (SurveyCTO) http://www.surveycto.com/ http://blog.surveycto.com/

On Tue, Sep 1, 2015 at 2:10 PM Tom Smyth tom@sassafras.coop wrote:

Reviving this ancient question. Anyone thought of an answer yet :stuck_out_tongue:

On Wed, Sep 25, 2013 at 3:25 PM, Thomas Smyth tom@sassafrastech.com wrote:

Say a question's skip logic refers to a prior question that is part of a
repeat group. Which 'instance' of the question does the logic get computed
on? The last one? The first one? Neither? Is this not allowed? Please
advise. Thanks.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
Tom Smyth

Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafras.coop · @sassafrastech

Resident, Touchstone Cohousing
touchstonecohousing.org

--

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.

You also have

current()
position(ref)

which are useful for tricky XPath expression constructions.
However, indexed-repeat() is much easier to wrap your brain around.

To prove that point, attached is a form using XPath expressions that
enforces the constraint that you enter people in order of increasing age.
Don't ask me to explain it.

repeat_increasing.xml (1.28 KB)

··· On Tue, Sep 1, 2015 at 11:22 AM, Christopher Robert wrote:

In JavaRosa, as implemented in Collect, references outside the repeat
group refer to ALL instances... so functions like join() or sum() work
well. Other functions or operators, which operate on one value at a time
(like +), will fail with an error. In recent versions of Collect, that
error will suggest that you use the indexed-repeat() function to specify
which instance you want. indexed-repeat() allows you to pass the entire set
of responses and which you want, and it returns that one.

Best,

Chris


Christopher Robert
Dobility, Inc. (SurveyCTO)
http://www.surveycto.com/
http://blog.surveycto.com/

On Tue, Sep 1, 2015 at 2:10 PM Tom Smyth tom@sassafras.coop wrote:

Reviving this ancient question. Anyone thought of an answer yet :stuck_out_tongue:

On Wed, Sep 25, 2013 at 3:25 PM, Thomas Smyth tom@sassafrastech.com wrote:

Say a question's skip logic refers to a prior question that is part of a
repeat group. Which 'instance' of the question does the logic get computed
on? The last one? The first one? Neither? Is this not allowed? Please
advise. Thanks.

--
Tom Smyth
Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafrastech.com

--
Tom Smyth

Worker-Owner, Sassafras Tech Collective
Specializing in innovative, usable tech for social change
sassafras.coop · @sassafrastech

Resident, Touchstone Cohousing
touchstonecohousing.org

--

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

3 posts were split to a new topic: Filter values from first repeat in follow-up repeat