Collect: nested groups in a form

hi,

after creating a quite long form, I need to add a "relevant" validation to
allow users replying the form or head them to the end of it. Since the form
was already created, I decided to define a group and add a bind like this:

but the form had a couple of groups already defined and now I'm facing with
some 'nested groups' issues, since data collected within the main group
can't be read from a child group. The issue is similar to this one:

http://groups.google.com/group/javarosa-developers/browse_thread/thread/e6f81b10c2d86433/16ead1cc459df056

I'm pretty sure that adding the relevant="/data/i11='HE' to all the
questions will work, but my question is whether there is an easier way to
achieve that. I always solved this 'reply yes or finish the form' by
grouping the questions and adding a relevant to the group's node, but it
does not work for the nested groups. There is any other way I'm not aware
of?

thanks!

pau.

The eIMCI form does this extensively -- groups used for this are not a
problem.

The cited issue refers to repeat groups, not simple non-repeating groups,
and is not a problem for what you are attempting to do.

I suspect you have not properly updated your formulas to refer to the
elements within this group, and have not wrapped the questions in the

within a construct.

e.g., original form:

...








...



...

... ...

form with a 'demographics' group added requires changes in the paths to the
data elements in all formulas.

... ... ... ... ...

Then 'age', which was referenced by /survey/age must now be referenced by
/survey/demographics/age. Similarly, references to 'gender' would need to
be updated.

Mitch

··· On Fri, May 25, 2012 at 2:58 AM, Pau Varela wrote:

hi,

after creating a quite long form, I need to add a "relevant" validation to
allow users replying the form or head them to the end of it. Since the form
was already created, I decided to define a group and add a bind like this:

but the form had a couple of groups already defined and now I'm facing
with some 'nested groups' issues, since data collected within the main
group can't be read from a child group. The issue is similar to this one:

http://groups.google.com/group/javarosa-developers/browse_thread/thread/e6f81b10c2d86433/16ead1cc459df056

I'm pretty sure that adding the relevant="/data/i11='HE' to all the
questions will work, but my question is whether there is an easier way to
achieve that. I always solved this 'reply yes or finish the form' by
grouping the questions and adding a relevant to the group's node, but it
does not work for the nested groups. There is any other way I'm not aware
of?

thanks!

pau.

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

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

hi Mitch,

thanks for your reply.. Actually, there is a repeat group involved.. sorry
if I didn't explain the situation clearly..

I have a group and, within this group, there is another group with a repeat
node: something like:

<h:body>

.....




.....



.....

The problem is with the jr:count in the repeat node. since /data/main/v24
is defined inside the 'main' group, it gets ignored and the repeat node
loops endlessly, with or without a jr:noAddRemove="true() (I've been never
sure what's this for).

I've been checking all the paths and they are correct (within the
<h:body>). If I remove the 'main' group, the repeat works just fine. I'll
probably have to add the skip pattern to all the nodes, but I was wondering
if there is any other way, or as said in the issue I linked, there is no
solution without moving the count source outside the group (something I
can't do)

In any case, thanks a lot for your response, it helped me clarifying the
behaviour..

pau.

··· 2012/5/25 Mitch S

The eIMCI form does this extensively -- groups used for this are not a
problem.

The cited issue refers to repeat groups, not simple non-repeating groups,
and is not a problem for what you are attempting to do.

I suspect you have not properly updated your formulas to refer to the
elements within this group, and have not wrapped the questions in the

within a construct.

e.g., original form:

...








...



...

... ...

form with a 'demographics' group added requires changes in the paths to
the data elements in all formulas.

... ... ... ... ...

Then 'age', which was referenced by /survey/age must now be referenced by
/survey/demographics/age. Similarly, references to 'gender' would need to
be updated.

Mitch

On Fri, May 25, 2012 at 2:58 AM, Pau Varela pau.varela@gmail.com wrote:

hi,

after creating a quite long form, I need to add a "relevant" validation
to allow users replying the form or head them to the end of it. Since the
form was already created, I decided to define a group and add a bind like
this:

but the form had a couple of groups already defined and now I'm facing
with some 'nested groups' issues, since data collected within the main
group can't be read from a child group. The issue is similar to this one:

http://groups.google.com/group/javarosa-developers/browse_thread/thread/e6f81b10c2d86433/16ead1cc459df056

I'm pretty sure that adding the relevant="/data/i11='HE' to all the
questions will work, but my question is whether there is an easier way to
achieve that. I always solved this 'reply yes or finish the form' by
grouping the questions and adding a relevant to the group's node, but it
does not work for the nested groups. There is any other way I'm not aware
of?

thanks!

pau.

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

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

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