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.
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.
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.
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.
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.
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.
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.
... 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.
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.
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.
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.