Professional Documents
Culture Documents
AMPScript Code Basics
AMPScript Code Basics
Constants:
1) String:- String must be quoted by single or double quotes.
2) Numeric:- Without any quotes and comma. Can be negative and also consist
decimal
3) Boolean:- Only true and false value.(Case sensitive)
Variables: Must consist VAR keyword followed by @ and at least one character
e.g VAR @name
Condition Checking:
> Greater than
< Less than
== equal to
!= not equal to
<= less than equal to
>= greater than equal to
AND ,OR , NOT operator
If else Statement
e.g.
%%[ if @fname==rishi’ then ]%%
do something
else
do nothing
endif
Loop (For loop)
Comment example
%%[ /* Insert Comment Here */ ]%
Keywords
Output() – echo the variable; OUTPUT(v(@fname))
OutputLine()
Function List
EMPTY – Check for blank value
Substring – SUBSTRING(‘Examle’,1,3) output will be Exa
Now() – Current date and time
s
Data Extensions
Subscriber->Data Extensionss