Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How to display different list for different iterations of a loop

eg. I have two online entertainment platforms. Platform A and Platform B.
both platforms have their unique list of shows, for eg, platform A has A1, A2, A3 and B has B1, B2, B3.. and so on.

Choice of platform A and B is a multi select question.

after this, i want to ask same set of questions for both platforms that means i will have a loop of 2 iterations.

but when the loop runs for platform A, i want to display the list of all shows of platform A as part of the grid questions and when the loop runs for B, i want to display the list of all shows on B, in the same way for platform A.

How do i achieve this ?
asked Nov 25, 2019 by kd

1 Answer

0 votes
There are a few ways to achieve this.  I think I would handle it with a constructed list.

You'll need to start by creating a predefined list with all the items for both platforms.  Then create a constructed list with this predefined list as its parent.  The constructed list needs these instructions:

Begin Unverified Perl
# Parameters
my $plist = 'list1';
my $loop = 'loop1';

# Run
if (LOOPVALUE($loop) == 1) {
    ADD($plist, 1, 4);
else {
    ADD($plist, 5, 8);
End Unverified

"list1" must be replaced with the name of the predefined list.  "loop1" must be replaced with the name of the loop.  The numbers on lines 8 and 11 can be updated to reflect which items in the parent list belong to each platform; I have assumed four items for each platform.

Finally, set your grid question to use this constructed list.
answered Nov 25, 2019 by Zachary Platinum Sawtooth Software, Inc. (147,200 points)