[ODK Community] Indexed-repeat error while referencing the index

One of the problems (features?) of ODK Collect is that any change to a
field in the form will re-compute the values for all fields that depend
upon the value for that field.

In this case, it is likely that the recalculation is trying to compute a
value for 'maxConstituency' before 'districtPosition' has a value.

You likely need to wrap the maxConstituency calculate in an if() expression
testing for a null value for that:

if(/district_min_list/districtPosition = null, '', ...original
expression... )

The test for null may need to be changed to test for zero (or perhaps both).

ยทยทยท On Tue, Jun 23, 2015 at 12:41 AM, Mero Raja Prasad Pradhan < merorajaram@gmail.com> wrote:

I'm working on a cascading select list that ultimately allows to select
another field based on the position of the selected field, but i'm having
an error.

On the calculate expression as follows:

calculate="indexed-repeat(instance('districts')/root/item/constituency ,
instance('districts')/root/item[developmentRegion=
/district_list/developmentRegion and zone= /district_min_list/zone and
district= /district_min_list/district]
,/district_min_list/districtPosition)"

This bring up an error while

calculate="indexed-repeat(instance('districts')/root/item/constituency ,
instance('districts')/root/item[developmentRegion=
/district_list/developmentRegion and zone= /district_min_list/zone and
district= /district_min_list/district] ,1)"

But this doesn't bring up error but the position is fixed and returns the
same value again and again.

Is there a way around this...

--

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