Pulling answers out of a loop for subsequent questions

Hi all ... in a bit of a bind.

I have a brand question (multi-select) as part of a loop. After the loop is completed, I need to ask questions about any brand chosen in any loop.

Here's my code:


Begin Unverified Perl
# Params
my $aQuestion = 'A9';
my $loopList = 'A9Loop';

# Run
my $len = LISTLENGTH(PARENTLISTNAME());
for (my $i = 1; $i <= $len; $i++) {
if (GETVALUE($aQuestion . '_' . $i . '.' . LOOPVALUE($loopList))) {
ADD(PARENTLISTNAME(), $i);
}
}

End Unverified


Nothing is setting. I have checked that I'm using the correct names for the question and the loop.

Have also tried


Begin Unverified Perl
# Params
my $aQuestion = 'A9';
my $loopList = 'A9Loop';

# Run
my $len = LISTLENGTH(PARENTLISTNAME());
for (my $i = 1; $i <= $len; $i++) {
if (GETVALUE($aQuestion . '_' . $i . '.' . LOOPVALUE($loopList)) == 1) {
ADD(PARENTLISTNAME(), $i);
}
}

End Unverified


Nothing works. It would be great if we had an AIC for loops. I'm on 9.10.1

Resolved
2 replies