Repeat Label from Choices

I have a form that I want to use a repeat in but I want the label of each
repeat to be the value of that index entry in a choice. Is this possible
and if so, can someone give me an example?

For example:

type name label
geopoint Location Location
dateTime ReportDate Date Of Inspection
select_one types Type Damage Cause
select_one waterdepth WaterDepth Water Depth
begin repeat DamageRepeat
select_one damagetype Damage ${bldgsegment[repeat_count]}
end repeat

choices worksheet
bldgsegment 1 Foundation
bldgsegment 2 Superstructure
bldgsegment 3 Roofing
bldgsegment 4 Exterior Finish
bldgsegment 5 Interior Finish
bldgsegment 6 Doors/Windows
damagetype None None
damagetype Affected Affected affected.png
damagetype Minor Minor minor.png
damagetype Major Major major.png
damagetype Destroyed Destroyed destroyed.png

So I want the form to look something like this:

Foundation

  • None
  • Affected
  • Minor
  • Major
  • Destroyed

Superstructure

  • None
  • Affected
  • Minor
  • Major
  • Destroyed

.
.
.
Doors/Windows

  • None
  • Affected
  • Minor
  • Major
  • Destroyed

Priscilla,

The easiest thing to do is to ask what type of building segment you
have as the first question of the repeat and then use that response as
a label for the next questions.

You can then use jr:choice-name (more at
https://opendatakit.org/help/form-design/binding/) to output the
correct choice label, given the choice selection.

If you want to use repeat indexing somehow, position(..) will give you
the count of the repeat.

Yaw

ยทยทยท On Wed, Oct 5, 2016 at 8:29 PM, Priscilla Thoopthong wrote: > I have a form that I want to use a repeat in but I want the label of each > repeat to be the value of that index entry in a choice. Is this possible > and if so, can someone give me an example? > > For example: > > type name label > geopoint Location Location > dateTime ReportDate Date Of Inspection > select_one types Type Damage Cause > select_one waterdepth WaterDepth Water Depth > begin repeat DamageRepeat > select_one damagetype Damage ${bldgsegment[repeat_count]} > end repeat > > > choices worksheet > bldgsegment 1 Foundation > bldgsegment 2 Superstructure > bldgsegment 3 Roofing > bldgsegment 4 Exterior Finish > bldgsegment 5 Interior Finish > bldgsegment 6 Doors/Windows > damagetype None None > damagetype Affected Affected affected.png > damagetype Minor Minor minor.png > damagetype Major Major major.png > damagetype Destroyed Destroyed destroyed.png > > > > So I want the form to look something like this: > > Foundation > > None > Affected > Minor > Major > Destroyed > > Superstructure > > None > Affected > Minor > Major > Destroyed > > . > . > . > Doors/Windows > > None > Affected > Minor > Major > Destroyed > > > -- > You received this message because you are subscribed to the Google Groups > "ODK Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to opendatakit-developers+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.