Add-if with unverified perl

Hi there.

I am trying to add the list member of a previous page's Grid question if they answer a certain way. The bulleted list could be 1-7 options, depending on how many are selected as a certain value. This is what I came up with but it only works for one bullet (whatever is first selected as a 3 previously).

I am sure there's a way to simplify this down and ensure that it's additive (i.e., if 4 items are previously valued at 3, then those same four are bullet listed on the successive page).

Any help would be appreciated. Thanks.


How can we address each of the following?
<ul>
[% Begin Unverified Perl
if(GETVALUE("Questions_r1")==3){return "<li>" . LISTLABEL("List",1) . "</li>";}
if(GETVALUE("Questions_r2")==3){return "<li>" . LISTLABEL("List",2) . "</li>";}
if(GETVALUE("Questions_r3")==3){return "<li>" . LISTLABEL("List",3) . "</li>";}
if(GETVALUE("Questions_r4")==3){return "<li>" . LISTLABEL("List",4) . "</li>";}
if(GETVALUE("Questions_r5")==3){return "<li>" . LISTLABEL("List",5) . "</li>";}
if(GETVALUE("Questions_r6")==3){return "<li>" . LISTLABEL("List",6) . "</li>";}
if(GETVALUE("Questions_r7")==3){return "<li>" . LISTLABEL("List",7) . "</li>";}
End Unverified %]
</ul>

Resolved
4 replies