Have an idea?

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

Listing second member from another constructed list


I'm working on constructed list that should display product name on the survey based on another constructed list where product is randomized. I have to label two products from the list but upon checking on admin module, the script below does not return value of the second member of another constructed list. It only shows the value of the first member of the list.

Begin Unverified Perl
return "ProductName1";
return "ProductName1";
return "ProductName2";
End Unverified

asked Nov 23, 2021 by anonymous
The Value function doesn't support two arguments.  Are you using it to try to get the second item from a constructed list named "RandomizedProduct"?

1 Answer

0 votes
Change the 2nd and 3rd "if" to "elsif".

I am assuming your list names are correct. Perl is case sensitive so ensure you take the spelling and case type in to account.

Also insert [%%] around the entire Perl script ...

[%Begin Unverified Perl
End Unverified%]
answered Nov 23, 2021 by Paul Moon Platinum (101,255 points)