Can a Select multiple question populate consecutive repeats?

130
1
Jump to solution
07-07-2020 01:38 AM
PaulSweeney3
Occasional Contributor II

I was wondering if a select multiple answer can be used to populate a repeat section , i know i can constrain the repeats to the number of selected answers but i was also wondering if i could pre-populate the answers in the repeats as well.  i thought that a combination of the functions selected-at and count may work but i keep getting dependency errors 

so for example.

Question one 

  • a
  • b
  • c

Repeat 1

  • a

Repeat 2

  • b

Repeat 3

  • c
0 Kudos
1 Solution

Accepted Solutions
PaulSweeney3
Occasional Contributor II

I figured it out i was using  the combination of the functions selected-at and count but in the wrong way. I had it inside my repeat which was causing the issue i believe,  i moved it outside and set up a default answer in side my repeat to use as the count  field and then i just use a minus one to account for the indexing of the select multiple question. Works a treat and the repeats are also constrained to the number of selections in the select multiple question so as i add a repeat the answer is populated as required. 

selected-at(${Hazards_present},count(${default_1})-1)

View solution in original post

0 Kudos
1 Reply
PaulSweeney3
Occasional Contributor II

I figured it out i was using  the combination of the functions selected-at and count but in the wrong way. I had it inside my repeat which was causing the issue i believe,  i moved it outside and set up a default answer in side my repeat to use as the count  field and then i just use a minus one to account for the indexing of the select multiple question. Works a treat and the repeats are also constrained to the number of selections in the select multiple question so as i add a repeat the answer is populated as required. 

selected-at(${Hazards_present},count(${default_1})-1)

0 Kudos