Setting Variables
Once a variable is declared, it can be set. Variables are set using a syntax that comprises of four elements:
- the
setkeyword - the variable name
- a single equals symbol (
=) - a personalization string, constant or AMPscript function (which can contain nested functions).
Refer to the example below, where variables are set as a personalization string (@firstName), AMPscript function (@localDate) and constant (@promotionEndDate):
%%[
var @firstName, @localDate, @promotionEndDate
set @firstName = FirstName
set @localDate = SystemDateToLocalDate(Now())
set @promotionEndDate = '10/15/2018'
]%%