AMPscript Utility Functions

Use the AMPscript utility functions to perform several different types of tasks. The utility functions evaluate conditions, format numbers, output text, and more.

This section contains information about these AMPscript functions.

Function NameDescription
AttributeValue()Returns the value of an attribute.
Domain()Returns the domain part of an email address.
Empty()Tests to see if a variable has a value.
FormatCurrency()Formats a number as a currency value.
FormatNumber()Formats a number as a numeric type.
Guid()Returns a Globally Unique Identifier (GUID).
Iif()Returns one parameter if a condition is true, and a different parameter if it’s false.
IsEmailAddress()Tests whether an email address is well formed.
IsNull()Tests whether the value of a variable or function is null.
IsPhoneNumber()Tests whether the supplied parameter is a valid North American phone number.
Output()Returns the result of an AMPscript function.
OutputLine()Returns the result of an AMPscript function followed by a newline character.
RaiseError()Raises an error and stops the processing of an email job.
Random()Returns a random number within a defined range.
v()Outputs the value of a variable.