Please can someone help identify why I'm getting the error:

A variable name is not a valid because contains illegal characters. Variable names must begin with the @ symbol followed by one or more letters, numbers, or underscores. Variable Name: <*

On the following AMPscript:

%%[ VAR @VoucherPrefix, @Output, @CodeId

SET @CodeId = CodeId
SET @VoucherPrefix = VoucherPrefix

IF @VoucherPrefix == "ST20G1" THEN
SET @Output = 'Grade I Season Ticket'

ELSEIF @VoucherPrefix == "ST20G2" THEN
SET @Output = 'Grade II Season Ticket'

ELSEIF @VoucherPrefix == "ST20G3" THEN 
SET @Output = 'Grade II Season Ticket'

ELSEIf @VoucherPrefix == "ST20G4" THEN
SET @Output == 'Grade IV Season Ticket'


]%% %%=v(@Output)=%% 
  • Looks like the error is occurring somewhere else in your code. I'd also wrap your personalization strings in AttributeValue() -- e.g. AttributeValue("CodeId") Dec 14, 2020 at 19:37

1 Answer 1


You should only use double equality characters as logical operators. Simply change:

SET @Output == 'Grade IV Season Ticket'


SET @Output = 'Grade IV Season Ticket'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .