Interactive tool

AMPscript Playground

Write and run AMPscript in your browser — no SFMC account needed.

Code
Output
Run your code to see output here.

Use Lookup("DEName", "ReturnField", "LookupField", "Value") in your code to query these tables. Click a cell to edit it.

Data extensions
Subscribers
Products
Orders

Simulate URL query string parameters. Access them in code with RequestParameter("key") or v("key").

=
=
=
=

Simulates a URL like page.html?id=P001&utm_source=newsletter

String
Concat() Uppercase() Lowercase() Proper() Trim() LTrim() RTrim() Length() Substring() Replace() IndexOf()
Math
Add() Subtract() Multiply() Divide() Mod() Format()
Logic
IIF() Empty() IsNull() IF / THEN ELSEIF ELSE ENDIF
Date
Now() DateAdd()
Data
Lookup() LookupRows() RequestParameter() v()
Syntax
%%[ ]%% %%= =%% SET @var VAR @var Output() OutputLine() FOR / NEXT