Using Perl to assign numeric value to a text pass-in

Hi,

I have a pass-in variable from the URL ("brand") which has one of a number of known text values (e.g., "Costco," "Walmart," etc.). Later, I have Q4 referencing other brands, and I need the "brand" value removed (e.g., if brand=Costco, Costco would be removed from the Q4 list).

I was thinking to use Perl (see below) to set a numeric value to a hidden free format question ("poi") based on the string text in the "brand" field.

So my "poi" question has variables like this:

<input name="poi_Costco" id="poi_Costco" type="hidden">


Then on the page after that hidden question, I have this Perl code in the footer:


[% Begin Unverified Perl
if(VALUE("brand") eq "Costco"){
SETVALUE("poi", 1);
}

End Unverified %]



However, I'm getting an error when it should be loading the page with the Perl code.

What am I missing?

Note: I'm basing this plan off of this post: https://www.sawtoothsoftware.com/forum/5488/assign-a-value-to-a-string-variable?show=5488#q5488

Resolved
2 replies