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 table lists all of the AMPscript utility functions. The value in the Engagement column indicates whether Marketing Cloud Engagement supports the function. The value in the Next column indicates whether Marketing Cloud Next supports the function.

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