Set up relevant questions based on number of repeats entered by user

127
4
Jump to solution
2 weeks ago
dwold
by
Occasional Contributor II

I am trying to create relevant questions based on the number of answers a user inputs from a repeat section. In the example below, I only want Objectives 2, 3, 4 to appear if there is more than 1 objective entered in the Objectives repeat

Survey:

dwold_0-1713359829051.png

dwold_1-1713360114367.png

Form:

dwold_2-1713360224709.pngdwold_3-1713360262082.png

Tried this:

dwold_0-1713360996995.png

I entered 4 objectives:

dwold_1-1713361031406.png

but only 1 objective appears

dwold_2-1713361073965.png

 

 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

You can use count() for this.  count(${SomeQuestionInTheRepeat}) > 1 should do it.

View solution in original post

4 Replies
DougBrowning
MVP Esteemed Contributor

You can use count() for this.  count(${SomeQuestionInTheRepeat}) > 1 should do it.

dwold
by
Occasional Contributor II

@DougBrowning awesome, that work perfectly. Thank you!! One last thing, if I want to bring in the answers from each repeat to part of the label. what's the best way to do that?

dwold_0-1713361644347.pngdwold_1-1713361660736.png

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Do you mean you want them to line up from the repeat like repeat 1 = label 1?  

If so I would take a look at this function  note it may not like this in the label - if it does not make a calculate field with this code then use that.

indexed-repeat(question, repeat, index number)

Returns the value from a specific question in a repeat record. For more information, see Repeats.

indexed-repeat(${room_no}, ${floor}, 3)

dwold
by
Occasional Contributor II

@DougBrowning yes, line up from the repeat like repeat 1 = label 1. thanks for the tip! I will look at using this