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 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 Name Description Engagement Next
AttributeValue() Returns the value of an attribute. ✅ Yes ❌ No
Base64Decode Converts Base64-encoded binary data to a string of plain text. ✅ Yes ✅ Yes
Base64Encode Converts plain text to Base64-encoded binary data. ✅ Yes ✅ Yes
Domain() Returns the domain part of an email address. ✅ Yes ✅ Yes
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 ✅ Yes
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 ✅ Yes
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