ODK Crashes - Choice filter and Groups

Hello,

I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I have a
household roster section at the beginning of the survey where I used the
choice filter to collect information on where people are from. So once
people choose a province, the territories they are able to choose from is
constrained based on province choice. Likewise, I use this feature to
filter subtribes after selection of tribe.

When answering questions for the second person (so when adding a new
group), I start to have problems. When trying to answer the territory or
subtribe questions, the error I get is "XPath evaluation: type mismatch
This field is repeated
/MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1] You may need to
use the indexed-repeat function to specify which value you want."

I am not sure what I should do to fix this problem. I am not sure how to
use the indexed-repeat function with XLSForm. Any advice would be much
appreciated. I have attached the xls document and xml document for
reference.

Thanks!

Sara

MainSurvey_2014.xls (318 KB)

MainSurvey_2014.xml (1.35 MB)

Are you using the ODK Collect bug-fix version that I sent out links to on
this list? Does that resolve the issue?

··· On Mon, Jun 30, 2014 at 4:39 AM, Sara Lowes wrote:

Hello,

I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I have
a household roster section at the beginning of the survey where I used the
choice filter to collect information on where people are from. So once
people choose a province, the territories they are able to choose from is
constrained based on province choice. Likewise, I use this feature to
filter subtribes after selection of tribe.

When answering questions for the second person (so when adding a new
group), I start to have problems. When trying to answer the territory or
subtribe questions, the error I get is "XPath evaluation: type mismatch
This field is repeated
/MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1] You may need to
use the indexed-repeat function to specify which value you want."

I am not sure what I should do to fix this problem. I am not sure how to
use the indexed-repeat function with XLSForm. Any advice would be much
appreciated. I have attached the xls document and xml document for
reference.

Thanks!

Sara

--

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

Hello Mitch,

I am not sure. I am using the ODK Collect version I downloaded from the
website (http://opendatakit.org/downloads/). Should I be using something
else?

Thanks,
Sara

··· On Monday, June 30, 2014 10:04:34 PM UTC+2, Mitch Sundt wrote: > > Are you using the ODK Collect bug-fix version that I sent out links to on > this list? Does that resolve the issue? > > > > On Mon, Jun 30, 2014 at 4:39 AM, Sara Lowes <sara....@gmail.com > wrote: > >> Hello, >> >> I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I have >> a household roster section at the beginning of the survey where I used the >> choice filter to collect information on where people are from. So once >> people choose a province, the territories they are able to choose from is >> constrained based on province choice. Likewise, I use this feature to >> filter subtribes after selection of tribe. >> >> When answering questions for the second person (so when adding a new >> group), I start to have problems. When trying to answer the territory or >> subtribe questions, the error I get is "XPath evaluation: type mismatch >> This field is repeated >> /MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1] You may need to >> use the indexed-repeat function to specify which value you want." >> >> I am not sure what I should do to fix this problem. I am not sure how to >> use the indexed-repeat function with XLSForm. Any advice would be much >> appreciated. I have attached the xls document and xml document for >> reference. >> >> Thanks! >> >> Sara >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@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...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

Hi Sara,

The thread is at
https://groups.google.com/d/msg/opendatakit-developers/_5A8_kuzgRI/GL_1wob35lIJ.

Can you try the build there and see if it fixes the issue?

Yaw

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

On Tue, Jul 1, 2014 at 1:32 AM, Sara Lowes sara.lowes@gmail.com wrote:

Hello Mitch,

I am not sure. I am using the ODK Collect version I downloaded from the
website (http://opendatakit.org/downloads/). Should I be using something
else?

Thanks,
Sara

On Monday, June 30, 2014 10:04:34 PM UTC+2, Mitch Sundt wrote:

Are you using the ODK Collect bug-fix version that I sent out links to on
this list? Does that resolve the issue?

On Mon, Jun 30, 2014 at 4:39 AM, Sara Lowes sara....@gmail.com wrote:

Hello,

I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I have
a household roster section at the beginning of the survey where I used the
choice filter to collect information on where people are from. So once
people choose a province, the territories they are able to choose from is
constrained based on province choice. Likewise, I use this feature to filter
subtribes after selection of tribe.

When answering questions for the second person (so when adding a new
group), I start to have problems. When trying to answer the territory or
subtribe questions, the error I get is "XPath evaluation: type mismatch This
field is repeated /MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1]
You may need to use the indexed-repeat function to specify which value you
want."

I am not sure what I should do to fix this problem. I am not sure how to
use the indexed-repeat function with XLSForm. Any advice would be much
appreciated. I have attached the xls document and xml document for
reference.

Thanks!

Sara

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.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/d/optout.

Hi Mitch,

The problem seems to be with absolute vs relative referencing. If I make
the following changes (see below) by directly editing the xml files then it
works. Is there a way to avoid having to do this?

Thank you.

Best,
Sara

1) For the Sub-Tribe referencing: Replace this:

        <itemset nodeset="instance('subtribe')/root/item[tribe= 

/MainSurvey_2014/GA3/B3/B16 ]">

With this:

         <itemset nodeset="instance('subtribe')/root/item[tribe= 

current()/B16 ]">

2) For the Village/Province/Territory referencing. Replace these 3
things:

          <itemset nodeset="instance('territory')/root/item[province= 

/MainSurvey_2014/GA3/B3/GB2/B24 ]">

          <itemset nodeset="instance('territory')/root/item[province= 

/MainSurvey_2014/GA3/B3/GB4/B29 ]">

         <itemset nodeset="instance('territory')/root/item[province= 

/MainSurvey_2014/GC1/GC6/GC7/C47 ]">

With This:

           <itemset nodeset="instance('territory')/root/item[province= 

current()/B24 ]">

          <itemset nodeset="instance('territory')/root/item[province= 

current()/B29 ]">

         <itemset nodeset="instance('territory')/root/item[province= 

current()/C47 ]">

··· On Tuesday, July 1, 2014 10:32:13 AM UTC+2, Sara Lowes wrote: > > Hello Mitch, > > I am not sure. I am using the ODK Collect version I downloaded from the > website (http://opendatakit.org/downloads/). Should I be using something > else? > > Thanks, > Sara > > On Monday, June 30, 2014 10:04:34 PM UTC+2, Mitch Sundt wrote: >> >> Are you using the ODK Collect bug-fix version that I sent out links to on >> this list? Does that resolve the issue? >> >> >> >> On Mon, Jun 30, 2014 at 4:39 AM, Sara Lowes wrote: >> >>> Hello, >>> >>> I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I >>> have a household roster section at the beginning of the survey where I used >>> the choice filter to collect information on where people are from. So once >>> people choose a province, the territories they are able to choose from is >>> constrained based on province choice. Likewise, I use this feature to >>> filter subtribes after selection of tribe. >>> >>> When answering questions for the second person (so when adding a new >>> group), I start to have problems. When trying to answer the territory or >>> subtribe questions, the error I get is "XPath evaluation: type mismatch >>> This field is repeated >>> /MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1] You may need to >>> use the indexed-repeat function to specify which value you want." >>> >>> I am not sure what I should do to fix this problem. I am not sure how to >>> use the indexed-repeat function with XLSForm. Any advice would be much >>> appreciated. I have attached the xls document and xml document for >>> reference. >>> >>> Thanks! >>> >>> Sara >>> >>> -- >>> -- >>> Post: opend...@googlegroups.com >>> Unsubscribe: opendatakit...@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...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Mitch Sundt >> Software Engineer >> University of Washington >> mitche...@gmail.com >> >

No. The fields are within a repeat group (B3), so you cannot use absolute
referencing.

I am not sure your current()/B16 reference is correct. I think you might
need current()/../B16
where the ../ moves you from the B23 prompt context up to the B3 repeat
group, and then the B16 retrieves the value of the B16 field.

The same applies for the other references. I haven't looked through all the
usages, but you might need to use ../ to navigate to the correct field
value.

Mitch

··· On Tue, Jul 1, 2014 at 7:08 AM, Sara Lowes wrote:

Hi Mitch,

The problem seems to be with absolute vs relative referencing. If I make
the following changes (see below) by directly editing the xml files then it
works. Is there a way to avoid having to do this?

Thank you.

Best,
Sara

1) For the Sub-Tribe referencing: Replace this:

        <itemset nodeset="instance('subtribe')/root/item[tribe=

/MainSurvey_2014/GA3/B3/B16 ]">

With this:

         <itemset nodeset="instance('subtribe')/root/item[tribe=

current()/B16 ]">

2) For the Village/Province/Territory referencing. Replace these 3
things:

          <itemset nodeset="instance('territory')/root/item[province=

/MainSurvey_2014/GA3/B3/GB2/B24 ]">

          <itemset nodeset="instance('territory')/root/item[province=

/MainSurvey_2014/GA3/B3/GB4/B29 ]">

         <itemset nodeset="instance('territory')/root/item[province=

/MainSurvey_2014/GC1/GC6/GC7/C47 ]">

With This:

           <itemset

nodeset="instance('territory')/root/item[province= current()/B24 ]">

          <itemset nodeset="instance('territory')/root/item[province=

current()/B29 ]">

         <itemset nodeset="instance('territory')/root/item[province=

current()/C47 ]">

On Tuesday, July 1, 2014 10:32:13 AM UTC+2, Sara Lowes wrote:

Hello Mitch,

I am not sure. I am using the ODK Collect version I downloaded from the
website (http://opendatakit.org/downloads/). Should I be using something
else?

Thanks,
Sara

On Monday, June 30, 2014 10:04:34 PM UTC+2, Mitch Sundt wrote:

Are you using the ODK Collect bug-fix version that I sent out links to
on this list? Does that resolve the issue?

On Mon, Jun 30, 2014 at 4:39 AM, Sara Lowes sara....@gmail.com wrote:

Hello,

I am using XLSForm to make a survey (and using ODK Collect 1.4.3). I
have a household roster section at the beginning of the survey where I used
the choice filter to collect information on where people are from. So once
people choose a province, the territories they are able to choose from is
constrained based on province choice. Likewise, I use this feature to
filter subtribes after selection of tribe.

When answering questions for the second person (so when adding a new
group), I start to have problems. When trying to answer the territory or
subtribe questions, the error I get is "XPath evaluation: type mismatch
This field is repeated /MainSurvey_2014/GA3[1]/B3[1]/B16[1];/GA3[1]/B3[2]/B16[1]
You may need to use the indexed-repeat function to specify which value you
want."

I am not sure what I should do to fix this problem. I am not sure how
to use the indexed-repeat function with XLSForm. Any advice would be much
appreciated. I have attached the xls document and xml document for
reference.

Thanks!

Sara

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.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/d/optout.

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