Use previous answers from repeat

Hi

I have a form asking several times (repeat) for

  • Hole
    • Run

(1 hole can have several run and it is possibe to have several holes)

Then I would like to have the list of holes (defined previously) to appear in a next question :
Q: Choose the hole :
- H1
- H2 ...

I have attached the xls file produced by kobotoolbox.
In the section repeat group (group_si3mn63), I would like to have the list of the name of Trou (group_oy8am21)
I have tried to put ${Nom_trou} (but no success)

Thanks for any hint

Karim

RM3.xls (9.5 KB)

Hi

Got it with indexed-repeat

Cheers

Karim

··· Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit : > > Hi > > I have a form asking several times (repeat) for > > * Hole > * Run > > (1 hole can have several run and it is possibe to have several holes) > > Then I would like to have the list of holes (defined previously) to appear > in a next question : > Q: Choose the hole : > - H1 > - H2 ... > > I have attached the xls file produced by kobotoolbox. > In the section repeat group (group_si3mn63), I would like to have the list > of the name of Trou (group_oy8am21) > I have tried to put ${Nom_trou} (but no success) > > Thanks for any hint > > Karim

nope :frowning:

it just work for one repeat

_test _test

if 2 holes, I have the error attached :frowning:

rm_v2.xml (21.7 KB)

··· Le lundi 8 juin 2015 23:32:50 UTC+2, karim bernardet a écrit : > > Hi > > Got it with indexed-repeat > > Cheers > > Karim > > > Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit : >> >> Hi >> >> I have a form asking several times (repeat) for >> >> * Hole >> * Run >> >> (1 hole can have several run and it is possibe to have several holes) >> >> Then I would like to have the list of holes (defined previously) to >> appear in a next question : >> Q: Choose the hole : >> - H1 >> - H2 ... >> >> I have attached the xls file produced by kobotoolbox. >> In the section repeat group (group_si3mn63), I would like to have the >> list of the name of Trou (group_oy8am21) >> I have tried to put ${Nom_trou} (but no success) >> >> Thanks for any hint >> >> Karim > >

You have a nested repeat group. If you are trying to access elements from
that, you would need to use the nested form of the indexed-repeat:

e.g.,

indexed-repeat(${Type_pr_l_vement},
${group_cm8ku88},1,${group_dt8qr50},4)

··· On Tue, Jun 9, 2015 at 10:28 AM, karim bernardet wrote:

nope :frowning:

it just work for one repeat

_test _test

if 2 holes, I have the error attached :frowning:

Le lundi 8 juin 2015 23:32:50 UTC+2, karim bernardet a écrit :

Hi

Got it with indexed-repeat

Cheers

Karim

Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit :

Hi

I have a form asking several times (repeat) for

  • Hole
    • Run

(1 hole can have several run and it is possibe to have several holes)

Then I would like to have the list of holes (defined previously) to
appear in a next question :
Q: Choose the hole :
- H1
- H2 ...

I have attached the xls file produced by kobotoolbox.
In the section repeat group (group_si3mn63), I would like to have the
list of the name of Trou (group_oy8am21)
I have tried to put ${Nom_trou} (but no success)

Thanks for any hint

Karim

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

Thanks Mitch
So what to have for indexed-repeat please if I want to get the 1st
Hole_name within group_cm8ku88 ?
(i do not understand the syntax below)

Karim

··· Le mardi 9 juin 2015 22:48:07 UTC+2, Mitch Sundt a écrit : > > You have a nested repeat group. If you are trying to access elements from > that, you would need to use the nested form of the indexed-repeat: > > e.g., > > indexed-repeat(${Type_pr_l_vement}, > ${group_cm8ku88},1,${group_dt8qr50},4) > > > On Tue, Jun 9, 2015 at 10:28 AM, karim bernardet <karim.b...@gmail.com > wrote: > >> nope :-( >> >> it just work for one repeat >> >> >> >> >> > value="indexed-repeat(/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21/Hole_name,/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21,1)"/> >> _test >> >> >> > value="indexed-repeat(/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21/Hole_name,/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21,2)"/> >> _test >> >> >> >> if 2 holes, I have the error attached :-( >> >> >> Le lundi 8 juin 2015 23:32:50 UTC+2, karim bernardet a écrit : >>> >>> Hi >>> >>> Got it with indexed-repeat >>> >>> Cheers >>> >>> Karim >>> >>> >>> Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit : >>>> >>>> Hi >>>> >>>> I have a form asking several times (repeat) for >>>> >>>> * Hole >>>> * Run >>>> >>>> (1 hole can have several run and it is possibe to have several holes) >>>> >>>> Then I would like to have the list of holes (defined previously) to >>>> appear in a next question : >>>> Q: Choose the hole : >>>> - H1 >>>> - H2 ... >>>> >>>> I have attached the xls file produced by kobotoolbox. >>>> In the section repeat group (group_si3mn63), I would like to have the >>>> list of the name of Trou (group_oy8am21) >>>> I have tried to put ${Nom_trou} (but no success) >>>> >>>> Thanks for any hint >>>> >>>> Karim >>> >>> -- >> -- >> 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 >

The syntax is described briefly here:
https://opendatakit.org/help/form-design/binding/ :

indexed-repeat(field,group,index, subgroup,subidx, ssgrp,ssidx,...)

Writing ${field-name} assumes you are using XLSForm and writing the
expression in the XLS file that you are converting to your XML file.

So if you are using XLSForm, the syntax is

indexed-repeat(${fieldName},
${top-level-repeat-group-name}, index-within-top-level-repeat-group,
${1st-nested-repeat-group-name}, index-within-1st-nested-repeat-group,
${2nd-nested-repeat-group-name}, index-within-2nd-nested-repeat-group)

If you have more than 3 nested repeats, we don't have anything that
supports accessing a particular value within the most-nested repeat.

I am having a hard time reading your XML file, but it appears that
Hole_name is within at least two levels of repeat groups. The example I
gave earlier:

indexed-repeat(${Type_pr_l_vement},
${group_cm8ku88},1,${group_dt8qr50},4)

Is referencing the value of "Type_pr_l_vement" in the 4th repeat of
"group_dt8qr50" that occurs within the 1st repeat of "group_cm8ku88".

See the Gotchas ( https://opendatakit.org/help/form-design/workarounds/ )
for a note about using indexed-repeat() and avoiding failures.

··· On Tue, Jun 9, 2015 at 2:14 PM, karim bernardet wrote:

Thanks Mitch
So what to have for indexed-repeat please if I want to get the 1st
Hole_name within group_cm8ku88 ?
(i do not understand the syntax below)

Karim

Le mardi 9 juin 2015 22:48:07 UTC+2, Mitch Sundt a écrit :

You have a nested repeat group. If you are trying to access elements from
that, you would need to use the nested form of the indexed-repeat:

e.g.,

indexed-repeat(${Type_pr_l_vement},
${group_cm8ku88},1,${group_dt8qr50},4)

On Tue, Jun 9, 2015 at 10:28 AM, karim bernardet karim.b...@gmail.com wrote:

nope :frowning:

it just work for one repeat

_test _test

if 2 holes, I have the error attached :frowning:

Le lundi 8 juin 2015 23:32:50 UTC+2, karim bernardet a écrit :

Hi

Got it with indexed-repeat

Cheers

Karim

Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit :

Hi

I have a form asking several times (repeat) for

  • Hole
    • Run

(1 hole can have several run and it is possibe to have several holes)

Then I would like to have the list of holes (defined previously) to
appear in a next question :
Q: Choose the hole :
- H1
- H2 ...

I have attached the xls file produced by kobotoolbox.
In the section repeat group (group_si3mn63), I would like to have the
list of the name of Trou (group_oy8am21)
I have tried to put ${Nom_trou} (but no success)

Thanks for any hint

Karim

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

Many thanks for all those explanations

I have attached a simpler working xml form

kk3.xml (3.03 KB)

··· Le mercredi 10 juin 2015 00:32:18 UTC+2, Mitch Sundt a écrit : > > The syntax is described briefly here: > https://opendatakit.org/help/form-design/binding/ : > > indexed-repeat(field,group,index, subgroup,subidx, ssgrp,ssidx,...) > > Writing ${field-name} assumes you are using XLSForm and writing the > expression in the XLS file that you are converting to your XML file. > > So if you are using XLSForm, the syntax is > > indexed-repeat(${fieldName}, > ${top-level-repeat-group-name}, index-within-top-level-repeat-group, > ${1st-nested-repeat-group-name}, index-within-1st-nested-repeat-group, > ${2nd-nested-repeat-group-name}, index-within-2nd-nested-repeat-group) > > If you have more than 3 nested repeats, we don't have anything that > supports accessing a particular value within the most-nested repeat. > > I am having a hard time reading your XML file, but it appears that > Hole_name is within at least two levels of repeat groups. The example I > gave earlier: > > indexed-repeat(${Type_pr_l_vement}, > ${group_cm8ku88},1,${group_dt8qr50},4) > > Is referencing the value of "Type_pr_l_vement" in the 4th repeat of > "group_dt8qr50" that occurs within the 1st repeat of "group_cm8ku88". > > See the Gotchas ( https://opendatakit.org/help/form-design/workarounds/ ) > for a note about using indexed-repeat() and avoiding failures. > > > On Tue, Jun 9, 2015 at 2:14 PM, karim bernardet <karim.b...@gmail.com > wrote: > >> Thanks Mitch >> So what to have for indexed-repeat please if I want to get the 1st >> Hole_name within group_cm8ku88 ? >> (i do not understand the syntax below) >> >> Karim >> >> Le mardi 9 juin 2015 22:48:07 UTC+2, Mitch Sundt a écrit : >>> >>> You have a nested repeat group. If you are trying to access elements >>> from that, you would need to use the nested form of the indexed-repeat: >>> >>> e.g., >>> >>> indexed-repeat(${Type_pr_l_vement}, >>> ${group_cm8ku88},1,${group_dt8qr50},4) >>> >>> >>> On Tue, Jun 9, 2015 at 10:28 AM, karim bernardet wrote: >>> >>>> nope :-( >>>> >>>> it just work for one repeat >>>> >>>> >>>> >>>> >>>> >>> value="indexed-repeat(/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21/Hole_name,/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21,1)"/> >>>> _test >>>> >>>> >>>> >>> value="indexed-repeat(/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21/Hole_name,/rm_v2/group_cm8ku88/group_dt8qr50/group_oy8am21/group_tp9zm21,2)"/> >>>> _test >>>> >>>> >>>> >>>> if 2 holes, I have the error attached :-( >>>> >>>> >>>> Le lundi 8 juin 2015 23:32:50 UTC+2, karim bernardet a écrit : >>>>> >>>>> Hi >>>>> >>>>> Got it with indexed-repeat >>>>> >>>>> Cheers >>>>> >>>>> Karim >>>>> >>>>> >>>>> Le dimanche 31 mai 2015 22:38:47 UTC+2, karim bernardet a écrit : >>>>>> >>>>>> Hi >>>>>> >>>>>> I have a form asking several times (repeat) for >>>>>> >>>>>> * Hole >>>>>> * Run >>>>>> >>>>>> (1 hole can have several run and it is possibe to have several holes) >>>>>> >>>>>> Then I would like to have the list of holes (defined previously) to >>>>>> appear in a next question : >>>>>> Q: Choose the hole : >>>>>> - H1 >>>>>> - H2 ... >>>>>> >>>>>> I have attached the xls file produced by kobotoolbox. >>>>>> In the section repeat group (group_si3mn63), I would like to have the >>>>>> list of the name of Trou (group_oy8am21) >>>>>> I have tried to put ${Nom_trou} (but no success) >>>>>> >>>>>> Thanks for any hint >>>>>> >>>>>> Karim >>>>> >>>>> -- >>>> -- >>>> 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: 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 >