Remove/Hide Selected option during a (next) repeat group

Hi Everyone,

I am trying to hide/remove a selected house hold member from list of
options (from indexed-repeat), to prevent showing it during the next
repeat. The issue i ran into is that the form works fine visually but the
data is missing from the fields. (see attached XML).

Short Version (what i did to prevent it showing up in next repeat):

<itemset nodeset="instance('nam')/root/item[(filtre !=
/Multiple_selections_Test/option/sqMem1) and (filtre !=
/Multiple_selections_Test/option/sqMem2) .... Upto All possible 10 Members >

This results in absolutely no data in selected member
and sqMem1, sqMem2, sqMem3 .... sqMem10 fields which are based on
calculation of the earlier select field. But works just as required .

Any help with this form or an example would be really appreciated.

Regards,
Ayub

selections.xml (14.7 KB)

Hi Everyone,

Given no replies in fair time, makes me highly doubtful about whether such
behavior would be possible. It would be really appreciated if any senior
members ( Yaw, Chris, Mitch ... or else ) add something to it.

Thanks,

Regards,
Ayub

Ayub,

Silence doesn't mean it's impossible. It usually means that the answer
isn't obvious at first glance and no one has time to dig into it.

Yaw

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

On Tue, Sep 9, 2014 at 2:57 AM, Ayub nrspaggregate@gmail.com wrote:

Hi Everyone,

Given no replies in fair time, makes me highly doubtful about whether such
behavior would be possible. It would be really appreciated if any senior
members ( Yaw, Chris, Mitch ... or else ) add something to it.

Thanks,

Regards,
Ayub

--

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.

I am on it and will update if I found a working solution.

Thanks,

Ayub

Yaw,

It would be great if you or any other member could attach an example form
that demonstrates this functionality (probably from old archives). So far I
couldn't find a working solution for preventing already selected members
showing up again in group.

Best,
Ayub

Ayub,

Unfortunately, I'm out of ideas (and available cycles).
Hopefully others can chip in.

Yaw

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

On Mon, Sep 15, 2014 at 10:11 AM, Ayub nrspaggregate@gmail.com wrote:

Yaw,

It would be great if you or any other member could attach an example form
that demonstrates this functionality (probably from old archives). So far I
couldn't find a working solution for preventing already selected members
showing up again in group.

Best,
Ayub

--

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.

This type of form is probably not valid.

I.e., you are referencing field values that get changed by the values
within a repeat group to affect the values shown within that same repeat
group.

I hadn't actually thought that you could even do that. This should
definitely not be relied upon to continue to work in future releases.

I believe the problem you are encountering is that at the very end of the
form, when it is Marked as Finalized, the entire set of data is re-scanned
and re-validated. During that last scan, the field values from the last
pass through the form (after all the repeats) are used as the
starting-point for this last validation check. And at that point, the
fields have all be cleared or excluded from the list of choices.

I think you need to enforce a fixed order on the memberQuestions repeat so
that these questions are asked in the exact same order in which those
members were identified in the original repeat.

··· On Mon, Sep 15, 2014 at 10:17 AM, Yaw Anokwa wrote:

Ayub,

Unfortunately, I'm out of ideas (and available cycles).
Hopefully others can chip in.

Yaw

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

On Mon, Sep 15, 2014 at 10:11 AM, Ayub nrspaggregate@gmail.com wrote:

Yaw,

It would be great if you or any other member could attach an example form
that demonstrates this functionality (probably from old archives). So
far I
couldn't find a working solution for preventing already selected members
showing up again in group.

Best,
Ayub

--

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

Mitch, I tried following to force selections one by one, works great till
the "Mark as Finalized"

But at 'Mark as finalized form' it throws an error "sorry, this field is
required" and it is basically start of the 2nd repeat,

I am attaching simple version of the same form. I hope there would be some
work around to that.

Ayub

Edit : Had attached wrong file.

dynamic_list.xml (5.62 KB)

... haven't tested this, but the problem is the use of count(). This would
not work if, for example, you filled out 3 repeats, then used the hierarchy
view to go back and update the 1st one.

      <itemset nodeset="instance('nam')/root/item[(filtre =

count(/data/PeopleQuestion/perName))]">

use this:

      <itemset nodeset="instance('nam')/root/item[(filtre =

position(current()/..))]">

The expression current()/.. needs to refer to the repeat group. i.e., if
you nest questions within begin group ... .end group, you might need to add
an additional /.. to this to get back up to the repeat group.

··· On Mon, Sep 15, 2014 at 12:15 PM, Ayub wrote:

Mitch, I tried following to force selections one by one, works great till

the "Mark as Finalized"

But at 'Mark as finalized form' it throws an error "sorry, this field is
required" and it is basically start of the 2nd repeat,

I am attaching simple version of the same form. I hope there would be
some work around to that.

Ayub

Edit : Had attached wrong file.

--

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

Hi Mitch,

With:

I am only able to refer to the first person (5 times which is jr:count):

If I use additional /...

This gives out validate errors.

Is there a way I can refer current position of a *specific *nodeset for
repeat? i.e. instead of using position(current()/..) , give complete path
of the nodeset.

Thanks,

Ayub

Hi Mitch,

It seems like:

position(current()/..)

Is just stuck to 1, hence showing first member over and over again. Any
ideas on how to make it work?

Best,

Ayub

It appears that the itemset filter is being evaluated in the context of the
group that encloses the field, rather than in the context of the field
itself (which is what I would expect). This is likely a bug in ODK Collect.

      <itemset nodeset="instance('nam')/root/item[filtre =

position(current()/.)]">

I opened this issue
http://code.google.com/p/opendatakit/issues/detail?id=1070

Attached is a working form using the above itemset expression.

dynamic_list.xml (5.88 KB)

··· On Thu, Sep 25, 2014 at 11:29 PM, Ayub wrote:

Hi Mitch,

It seems like:

position(current()/..)

Is just stuck to 1, hence showing first member over and over again. Any
ideas on how to make it work?

Best,

Ayub

--

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

Hi Mitch,

Attached form works just as intended (just needed to remove the comment on
line 161).

Thanks for your help and filing the issue, hope it gets resolved soon.