Index of AMPscript Functions

We organized the functions in this reference guide into categories based on the types of data that each function interacts with. For example, you can find information about AMPscript functions that manipulate dates and times in the Date & Time Functions category.

The purpose of this index is to make it easier to explore and discover AMPscript functions that you might not have encountered otherwise. This table lists all of the existing AMPscript functions in alphabetical order. In the table, the value in the Engagement column indicates whether the function works in Marketing Cloud Engagement, and the value in the Next column indicates whether the function works in Marketing Cloud Next.

Function Name Category Description Engagement Next
Add() Math Returns the sum of two numbers. ✅ Yes ✅ Yes
AddMscrmListMember() Microsoft Dynamics CRM Adds a record to a Microsoft Dynamics CRM marketing list. ✅ Yes ❌ No
AddObjectArrayItem() API Adds an object to an array in a Marketing Cloud Engagement API object. ✅ Yes ❌ No
AttributeValue() Utilities Returns the value of an attribute. ✅ Yes ❌ No
AttachFile() Content Attaches a file to an outgoing email message. ✅ Yes ❌ No
AuthenticatedEmployeeId() Sites Returns the employee ID of the current Marketing Cloud Engagement user. ✅ Yes ❌ No
AuthenticatedEmployeeNotificationAddress() Sites Returns the email address of the current Marketing Cloud Engagement user. ✅ Yes ❌ No
AuthenticatedEmployeeUserName() Sites Returns the username of the current Marketing Cloud Engagement user. ✅ Yes ❌ No
AuthenticatedEnterpriseID() Sites Returns the enterprise ID of the current authenticated landing page user. ✅ Yes ❌ No
AuthenticatedMemberID() Sites Returns the member ID of the authenticated landing page user. ✅ Yes ❌ No
AuthenticatedMemberName() Sites Returns the member name of the authenticated landing page user. ✅ Yes ❌ No
BarcodeUrl() Content Generates a barcode based on an input string. ✅ Yes ❌ No
Base64Decode Utilities Converts Base64-encoded binary data to a string of plain text. ✅ Yes ✅ Yes
Base64Encode Utilities Converts plain text to Base64-encoded binary data. ✅ Yes ✅ Yes
BeginImpressionRegion() Content Denotes the beginning of a region to track with impression tracking. ✅ Yes ✅ Yes
BuildOptionList() Content Creates a set of <option> tags that you can integrate into an HTML form on a CloudPage. ✅ Yes ❌ No
BuildRowsetFromJson() Content Creates a rowset from JSON data. ✅ Yes ✅ Yes
BuildRowsetFromString() Content Creates a rowset from a character string. ✅ Yes ✅ Yes
BuildRowsetFromXml() Content Creates a rowset from XML data. ✅ Yes ✅ Yes
Char() String Returns a character when passed an ASCII character code. ✅ Yes ✅ Yes
ClaimRow() Data Extensions Returns the first unclaimed row from a data extension. ✅ Yes ✅ Yes
ClaimRowValue() Data Extensions Searches a data extension for an unclaimed row and returns a value from that row. ✅ Yes ✅ Yes
CloudPagesURL() Sites Returns a CloudPages URL with an encrypted query string. ✅ Yes ❌ No
Concat() String Concatenates strings of text. ✅ Yes ✅ Yes
ContentArea() Content Returns content contained in the specified content area by referencing its ID. ✅ Yes ❌ No
ContentAreaByName() Content Returns content contained in the specified content area by referencing its name. ✅ Yes ❌ No
ContentBlockById() Content Returns the content contained in a content block by referencing its ID. ✅ Yes ✅ Yes
ContentBlockByKey() Content Returns the content contained in a content block by referencing its key. ✅ Yes ✅ Yes
ContentBlockByName() Content Returns the content contained in a content block by referencing its name. ✅ Yes ✅ Yes
ContentImageById() Content Returns the path to an image from Content Builder by referencing its ID. ✅ Yes ❌ No
ContentImageByKey() Content Returns the path to an image from Content Builder by referencing its key. ✅ Yes ❌ No
CreateMscrmRecord() Microsoft Dynamics CRM Creates a record in a Microsoft Dynamics CRM entity. ✅ Yes ❌ No
CreateObject() API Creates an API object. ✅ Yes ❌ No
CreateSalesforceObject() Salesforce Creates a record in a Sales Cloud or Service Cloud object. ✅ Yes ❌ No
CreateSmsConversation() SMS Creates an SMS conversation. ✅ Yes ❌ No
DataExtensionRowCount() Data Extensions Returns the number of rows in a data extension. ✅ Yes ❌ No
DateAdd() Date & Time Adds a specified time value to a date. ✅ Yes ✅ Yes
DateDiff() Date & Time Returns the difference between two dates or times. ✅ Yes ✅ Yes
DateParse() Date & Time Returns a DateTime object from a date string. ✅ Yes ✅ Yes
DatePart() Date & Time Extracts a date part from a date or timestamp string. ✅ Yes ✅ Yes
DecryptSymmetric() Encryption Decrypts encrypted data using the supplied algorithm and encryption values. ✅ Yes ❌ No
DeleteData() Data Extensions Deletes rows from a data extension in CloudPages, microsites, landing pages, and SMS messages. ✅ Yes ❌ No
DeleteDE() Data Extensions Deletes rows from a data extension in an email. ✅ Yes ❌ No
DescribeMscrmEntities() Microsoft Dynamics CRM Returns the logical and display names of all Microsoft Dynamics CRM entities. ✅ Yes ❌ No
DescribeMscrmEntityAttributes() Microsoft Dynamics CRM Retrieves information about the attributes of a Microsoft Dynamics CRM entity. ✅ Yes ❌ No
Divide() Math Returns the result of dividing the first parameter by the second parameter. ✅ Yes ✅ Yes
Domain() Utilities Returns the domain part of an email address. ✅ Yes ✅ Yes
Empty() Utilities Tests to see if a variable has a value. ✅ Yes ✅ Yes
EncryptSymmetric() Encryption Encrypts plain text data using the supplied algorithm and encryption values. ✅ Yes ❌ No
EndImpressionRegion() Content Denotes the end of an impression tracking region. ✅ Yes ✅ Yes
EndSmsConversation() SMS End an active SMS conversation. ✅ Yes ❌ No
ExecuteFilter() Data Extensions Executes a data filter and returns an unordered rowset that contains the results. ✅ Yes ❌ No
ExecuteFilterOrderedRows() Data Extensions Executes a data filter and returns an ordered rowset that contains the results. ✅ Yes ❌ No
Field() Data Extensions Returns a specific field from a data row or record. ✅ Yes ✅ Yes
Format() String Formats a string in the specified format. ✅ Yes ✅ Yes
FormatCurrency() Utilities Formats a number as a currency value. ✅ Yes ✅ Yes
FormatDate() Date & Time Formats a string as a date value. ✅ Yes ✅ Yes
FormatNumber() Utilities Formats a number as a numeric type. ✅ Yes ✅ Yes
GetJwt() Encryption Creates a JSON Web Token. ✅ Yes ❌ No
GetJwtByKeyName() Encryption Creates a JSON Web Token by using a key stored in Key Management. ✅ Yes ❌ No
GetPortfolioItem() Content Returns the content of a file in your Portfolio. ✅ Yes ❌ No
GetPublishedSocialContent() Social Returns content to share on a social media site. ✅ Yes ❌ No
GetSendTime() Date & Time Returns a timestamp for the beginning or end of a send. ✅ Yes ❌ No
GetSocialPublishUrl() Social Returns HTML code for sharing a content region on a supported social network. ✅ Yes ❌ No
GetSocialPublishUrlByName() Social Returns HTML code for sharing a content region on a supported social network. ✅ Yes ❌ No
Guid() Utilities Returns a Globally Unique Identifier (GUID). ✅ Yes ✅ Yes
HttpGet() HTTP Returns the content from a specified URL. ✅ Yes ❌ No
HttpPost() HTTP Sends data to a URL using the POST method. ✅ Yes ❌ No
HttpPost2() HTTP Sends data to a URL using the POST method with additional error handling. ✅ Yes ❌ No
Iif() Utilities Returns one parameter if a condition is true and a different parameter if it’s false. ✅ Yes ✅ Yes
Image() Content Returns the path to an image from your Portfolio by referencing its ID. ✅ Yes ❌ No
IndexOf() String Returns the position at which a substring occurs within a string. ✅ Yes ✅ Yes
InsertDE() Data Extensions Inserts rows into a data extension in emails. ✅ Yes ❌ No
InsertData() Data Extensions Inserts rows into a data extension in CloudPages, microsites, landing pages, and SMS messages. ✅ Yes ❌ No
InvokeCreate() API Invokes the Create method on an API object. ✅ Yes ❌ No
InvokeDelete() API Invokes the Delete method on an API object. ✅ Yes ❌ No
InvokeExecute() API Invokes the Execute method on an API object. ✅ Yes ❌ No
InvokePerform() API Invokes the Perform method on an API object. ✅ Yes ❌ No
InvokeRetrieve() API Invokes the Retrieve method on an API object. ✅ Yes ❌ No
InvokeUpdate() API Invokes the Update method on an API object. ✅ Yes ❌ No
IsChtmlBrowser() HTTP Returns a value that indicates if a device’s user agent is a CHTML browser. ✅ Yes ❌ No
IsEmailAddress() Utilities Tests whether an email address is well formed. ✅ Yes ✅ Yes
IsNull() Utilities Tests whether the value of a variable or function is null. ✅ Yes ✅ Yes
IsNullDefault() Sites Lets you create default values for empty fields in Smart Capture forms. ✅ Yes ✅ Yes
IsPhoneNumber() Utilities Tests whether the supplied parameter is a valid North American phone number. ✅ Yes ❌ No
Length() String Returns the number of characters in a string. ✅ Yes ✅ Yes
LiveContentMicrositeURL() Sites Returns a link to view live content on a microsite. ✅ Yes ❌ No
LocalDateToSystemDate() Date & Time Converts a local datetime string to the system time. ✅ Yes ❌ No
LongSfid() Salesforce Returns an 18-character Salesforce ID when provided with a 15-character ID. ✅ Yes ❌ No
Lookup() Data Extensions Returns a value from a data extension or marketing object. ✅ Yes ✅ Yes
LookupOrderedRows() Data Extensions Returns rows from a data extension sorted in ascending or descending order (case-insensitive). ✅ Yes ✅ Yes
LookupOrderedRowsCS() Data Extensions Returns rows from a data extension sorted in ascending or descending order (case-sensitive). ✅ Yes ❌ No
LookupRows() Data Extensions Returns an unordered rowset from a data extension (case-insensitive). ✅ Yes ✅ Yes
LookupRowsCS() Data Extensions Returns an unordered rowset from a data extension (case-sensitive). ✅ Yes ❌ No
Lowercase() String Returns the provided string using only lowercase letters. ✅ Yes ✅ Yes
MD5() Encryption Converts a string to a 128-bit hexadecimal MD5 hash. ✅ Yes ✅ Yes
MicrositeURL() Sites Returns a microsite URL with an encrypted query string. ✅ Yes ❌ No
MMS_Content_URL() SMS Returns the URL of a content item from an inbound MMS message. ✅ Yes ❌ No
Mod() Math Returns the remainder after dividing the first parameter by the second parameter. ✅ Yes ✅ Yes
Msg() SMS Returns the body of an incoming message. ✅ Yes ❌ No
Multiply() Math Returns the product of two numbers. ✅ Yes ✅ Yes
Noun() SMS Returns a word from an incoming message based on its position. ✅ Yes ❌ No
Nouns SMS Returns all of the message content after the keyword in an incoming message. ✅ Yes ❌ No
Now() Date & Time Returns the current system timestamp. ✅ Yes ✅ Yes
Output() Utilities Returns the result of an AMPscript function. ✅ Yes ✅ Yes
OutputLine() Utilities Returns the result of an AMPscript function followed by a newline character. ✅ Yes ✅ Yes
ProperCase() String Returns specified string with the first letter of each word capitalized. ✅ Yes ✅ Yes
QueryParameter() Sites Retrieves a value from a URL query string. ✅ Yes ❌ No
RaiseError() Utilities Raises an error and stops the processing of an email job. ✅ Yes ✅ Yes
Random() Utilities Returns a random number within a defined range. ✅ Yes ✅ Yes
Redirect() Sites Redirects landing page visitors to a different URL. ✅ Yes ❌ No
RedirectTo() HTTP Creates a link using data from an attribute, data extension field, or variable. ✅ Yes ❌ No
RegExMatch() String Searches for a pattern in a string using a regular expression. ✅ Yes ✅ Yes
Replace() String Replaces every occurrence of one substring with a different substring. ✅ Yes ✅ Yes
ReplaceList() String Replaces one or more substrings with another string. ✅ Yes ✅ Yes
RequestHeader() HTTP Retrieves the header from an HTTP request for a landing page. ✅ Yes ❌ No
RequestParameter() Sites Returns the value of a parameter from a form field or landing page URL parameter. ✅ Yes ❌ No
RetrieveMscrmRecords() Microsoft Dynamics CRM Retrieves data from Microsoft Dynamics CRM entities. ✅ Yes ❌ No
RetrieveMscrmRecordsFetchXml() Microsoft Dynamics CRM Returns the attributes specified in a Fetch XML query. ✅ Yes ❌ No
RetrieveSalesforceJobSources() Salesforce Returns a rowset that contains information about a send. ✅ Yes ❌ No
RetrieveSalesforceObjects() Salesforce Returns a rowset that contains data that matches the criteria you specify. ✅ Yes ✅ Yes
Row() Data Extensions Returns a row from a rowset, array, or object. ✅ Yes ✅ Yes
RowCount() Data Extensions Returns the number of rows in a rowset, array, or object. ✅ Yes ✅ Yes
SetObjectProperty() API Sets a value for an object created by the CreateObject() function. ✅ Yes ❌ No
SetSmsConversationNextKeyword() SMS Sets the keyword in an SMS conversation. ✅ Yes ❌ No
SetStateMscrmRecord() Microsoft Dynamics CRM Sets the state and status of a Microsoft Dynamics CRM record. ✅ Yes ❌ No
SHA1() Encryption Converts a string to a 160-bit hexadecimal SHA-1 hash. ✅ Yes ✅ Yes
SHA256() Encryption Converts a string to a 256-bit hexadecimal SHA-2 hash. ✅ Yes ✅ Yes
SHA512() Encryption Converts a string to a 512-bit hexadecimal SHA-2 hash. ✅ Yes ✅ Yes
StringToDate() Date & Time Converts a date string to a .NET datetime object. ✅ Yes ✅ Yes
StringToHex() String Converts each character in a string to its hexadecimal equivalent. ✅ Yes ✅ Yes
Subtract() Math Returns the result of subtracting the second parameter from the first parameter. ✅ Yes ✅ Yes
SubString() String Returns a portion of a string, beginning at a specified character position. ✅ Yes ✅ Yes
SystemDateToLocalDate() Date & Time Converts the system time to a local datetime string. ✅ Yes ❌ No
TransformXml() Content Apply an XSL transformation to XML data. ✅ Yes ❌ No
TreatAsContent() Content Treats a string as though it came in from a content area. ✅ Yes ❌ No
TreatAsContentArea() Content Treats content from a data extension as though it came from a content area. ✅ Yes ❌ No
Trim() String Removes white space from the beginning and end of a string. ✅ Yes ✅ Yes
UpdateData() Data Extensions Updates data in a data extension in CloudPages, microsites, landing pages, and SMS messages. ✅ Yes ❌ No
UpdateDE() Data Extensions Updates data in a data extension in emails. ✅ Yes ❌ No
UpdateMscrmRecords() Microsoft Dynamics CRM Updates one or more records in a Microsoft Dynamics CRM entity. ✅ Yes ❌ No
UpdateSingleSalesforceObject() Salesforce Updates a record in a Salesforce object. ✅ Yes ❌ No
UpsertContact() Contacts Upserts attributes into a contact record. ✅ Yes ❌ No
UpsertData() Data Extensions Upserts data in a data extension in CloudPages, microsites, landing pages, and SMS messages. ✅ Yes ❌ No
UpsertDE() Data Extensions Upserts data in a data extension in emails. ✅ Yes ❌ No
UpsertMscrmRecord() Microsoft Dynamics CRM Upserts a Microsoft Dynamics CRM record. ✅ Yes ❌ No
Uppercase() String Returns the provided string using only uppercase letters. ✅ Yes ✅ Yes
UrlEncode() HTTP Modifies a string to include only characters that are safe to use in URLs. ✅ Yes ✅ Yes
v() Utilities Outputs the value of a variable. ✅ Yes ✅ Yes
Verb SMS Returns the keyword from an incoming message. ✅ Yes ❌ No
WAT() and WATP() Content Returns the values of a Web Analytics Tracking (WAT) parameter. ✅ Yes ❌ No
WrapLongURL() HTTP Returns a shortened URL when provided with a long URL. ✅ Yes ❌ No