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 NameCategoryDescriptionEngagementNext
Add()MathReturns the sum of two numbers.✅ Yes✅ Yes
AddMscrmListMember()Microsoft Dynamics CRMAdds a record to a Microsoft Dynamics CRM marketing list.✅ Yes❌ No
AddObjectArrayItem()APIAdds an object to an array in a Marketing Cloud Engagement API object.✅ Yes❌ No
AttributeValue()UtilitiesReturns the value of an attribute.✅ Yes❌ No
AttachFile()ContentAttaches a file to an outgoing email message.✅ Yes❌ No
AuthenticatedEmployeeId()SitesReturns the employee ID of the current Marketing Cloud Engagement user.✅ Yes❌ No
AuthenticatedEmployeeNotificationAddress()SitesReturns the email address of the current Marketing Cloud Engagement user.✅ Yes❌ No
AuthenticatedEmployeeUserName()SitesReturns the username of the current Marketing Cloud Engagement user.✅ Yes❌ No
AuthenticatedEnterpriseID()SitesReturns the enterprise ID of the current authenticated landing page user.✅ Yes❌ No
AuthenticatedMemberID()SitesReturns the member ID of the authenticated landing page user.✅ Yes❌ No
AuthenticatedMemberName()SitesReturns the member name of the authenticated landing page user.✅ Yes❌ No
BarcodeUrl()ContentGenerates a barcode based on an input string.✅ Yes❌ No
BeginImpressionRegion()ContentDenotes the beginning of a region to track with impression tracking.✅ Yes❌ No
BuildOptionList()ContentCreates a set of <option> tags that you can integrate into an HTML form on a CloudPage.✅ Yes❌ No
BuildRowsetFromJson()ContentCreates a rowset from JSON data.✅ Yes✅ Yes
BuildRowsetFromString()ContentCreates a rowset from a character string.✅ Yes❌ No
BuildRowsetFromXml()ContentCreates a rowset from XML data.✅ Yes❌ No
Char()StringReturns a character when passed an ASCII character code.✅ Yes❌ No
ClaimRow()Data ExtensionsReturns the first unclaimed row from a data extension.✅ Yes❌ No
ClaimRowValue()Data ExtensionsSearches a data extension for an unclaimed row and returns a value from that row.✅ Yes❌ No
CloudPagesURL()SitesReturns a CloudPages URL with an encrypted query string.✅ Yes❌ No
Concat()StringConcatenates strings of text.✅ Yes✅ Yes
ContentArea()ContentReturns content contained in the specified content area by referencing its ID.✅ Yes❌ No
ContentAreaByName()ContentReturns content contained in the specified content area by referencing its name.✅ Yes❌ No
ContentBlockById()ContentReturns the content contained in a content block by referencing its ID.✅ Yes✅ Yes
ContentBlockByKey()ContentReturns the content contained in a content block by referencing its key.✅ Yes✅ Yes
ContentBlockByName()ContentReturns the content contained in a content block by referencing its name.✅ Yes✅ Yes
CreateMscrmRecord()Microsoft Dynamics CRMCreates a record in a Microsoft Dynamics CRM entity.✅ Yes❌ No
CreateObject()APICreates an API object.✅ Yes❌ No
CreateSalesforceObject()SalesforceCreates a record in a Sales Cloud or Service Cloud object.✅ Yes❌ No
CreateSmsConversation()SMSCreates an SMS conversation.✅ Yes❌ No
DataExtensionRowCount()Data ExtensionsReturns the number of rows in a data extension.✅ Yes❌ No
DateAdd()Date & TimeAdds a specified time value to a date.✅ Yes✅ Yes
DateDiff()Date & TimeReturns the difference between two dates or times.✅ Yes✅ Yes
DateParse()Date & TimeReturns a DateTime object from a date string.✅ Yes✅ Yes
DatePart()Date & TimeExtracts a date part from a date or timestamp string.✅ Yes❌ No
DecryptSymmetric()EncryptionDecrypts encrypted data using the supplied algorithm and encryption values.✅ Yes❌ No
DeleteData()Data ExtensionsDeletes rows from a data extension in CloudPages, microsites, landing pages, and SMS messages.✅ Yes❌ No
DeleteDE()Data ExtensionsDeletes rows from a data extension in an email.✅ Yes❌ No
DescribeMscrmEntities()Microsoft Dynamics CRMReturns the logical and display names of all Microsoft Dynamics CRM entities.✅ Yes❌ No
DescribeMscrmEntityAttributes()Microsoft Dynamics CRMRetrieves information about the attributes of a Microsoft Dynamics CRM entity.✅ Yes❌ No
Divide()MathReturns the result of dividing the first parameter by the second parameter.✅ Yes✅ Yes
Domain()UtilitiesReturns the domain part of an email address.✅ Yes❌ No
Empty()UtilitiesTests to see if a variable has a value.✅ Yes✅ Yes
EncryptSymmetric()EncryptionEncrypts plain text data using the supplied algorithm and encryption values.✅ Yes❌ No
EndImpressionRegion()ContentDenotes the end of an impression tracking region.✅ Yes❌ No
EndSmsConversation()SMSEnd an active SMS conversation.✅ Yes❌ No
ExecuteFilter()Data ExtensionsExecutes a data filter and returns an unordered rowset that contains the results.✅ Yes❌ No
ExecuteFilterOrderedRows()Data ExtensionsExecutes a data filter and returns an ordered rowset that contains the results.✅ Yes❌ No
Field()Data ExtensionsReturns a specific field from a data row or record.✅ Yes✅ Yes
Format()StringFormats a string in the specified format.✅ Yes✅ Yes
FormatCurrency()UtilitiesFormats a number as a currency value.✅ Yes✅ Yes
FormatDate()Date & TimeFormats a string as a date value.✅ Yes✅ Yes
FormatNumber()UtilitiesFormats a number as a numeric type.✅ Yes✅ Yes
GetJwt()EncryptionCreates a JSON Web Token.✅ Yes❌ No
GetJwtByKeyName()EncryptionCreates a JSON Web Token by using a key stored in Key Management.✅ Yes❌ No
GetPortfolioItem()ContentReturns the content of a file in your Portfolio.✅ Yes❌ No
GetPublishedSocialContent()SocialReturns content to share on a social media site.✅ Yes❌ No
GetSendTime()Date & TimeReturns a timestamp for the beginning or end of a send.✅ Yes❌ No
GetSocialPublishUrl()SocialReturns HTML code for sharing a content region on a supported social network.✅ Yes❌ No
GetSocialPublishUrlByName()SocialReturns HTML code for sharing a content region on a supported social network.✅ Yes❌ No
Guid()UtilitiesReturns a Globally Unique Identifier (GUID).✅ Yes❌ No
HttpGet()HTTPReturns the content from a specified URL.✅ Yes❌ No
HttpPost()HTTPSends data to a URL using the POST method.✅ Yes❌ No
HttpPost2()HTTPSends data to a URL using the POST method with additional error handling.✅ Yes❌ No
Iif()UtilitiesReturns one parameter if a condition is true and a different parameter if it’s false.✅ Yes✅ Yes
Image()ContentReturns the path to an image from your Portfolio by referencing its ID.✅ Yes❌ No
ImageById()ContentReturns the path to an image from Content Builder by referencing its ID.✅ Yes❌ No
ImageByKey()ContentReturns the path to an image from Content Builder by referencing its key.✅ Yes❌ No
IndexOf()StringReturns the position at which a substring occurs within a string.✅ Yes✅ Yes
InsertDE()Data ExtensionsInserts rows into a data extension in emails.✅ Yes❌ No
InsertData()Data ExtensionsInserts rows into a data extension in CloudPages, microsites, landing pages, and SMS messages.✅ Yes❌ No
InvokeCreate()APIInvokes the Create method on an API object.✅ Yes❌ No
InvokeDelete()APIInvokes the Delete method on an API object.✅ Yes❌ No
InvokeExecute()APIInvokes the Execute method on an API object.✅ Yes❌ No
InvokePerform()APIInvokes the Perform method on an API object.✅ Yes❌ No
InvokeRetrieve()APIInvokes the Retrieve method on an API object.✅ Yes❌ No
InvokeUpdate()APIInvokes the Update method on an API object.✅ Yes❌ No
IsChtmlBrowser()HTTPReturns a value that indicates if a device’s user agent is a CHTML browser.✅ Yes❌ No
IsEmailAddress()UtilitiesTests whether an email address is well formed.✅ Yes❌ No
IsNull()UtilitiesTests whether the value of a variable or function is null.✅ Yes✅ Yes
IsNullDefault()SitesLets you create default values for empty fields in Smart Capture forms.✅ Yes❌ No
IsPhoneNumber()UtilitiesTests whether the supplied parameter is a valid North American phone number.✅ Yes❌ No
Length()StringReturns the number of characters in a string.✅ Yes✅ Yes
LiveContentMicrositeURL()SitesReturns a link to view live content on a microsite.✅ Yes❌ No
LocalDateToSystemDate()Date & TimeConverts a local datetime string to the system time.✅ Yes❌ No
LongSfid()SalesforceReturns an 18-character Salesforce ID when provided with a 15-character ID.✅ Yes❌ No
Lookup()Data ExtensionsReturns a value from a data extension or marketing object.✅ Yes✅ Yes
LookupOrderedRows()Data ExtensionsReturns rows from a data extension sorted in ascending or descending order (case-insensitive).✅ Yes❌ No
LookupOrderedRowsCS()Data ExtensionsReturns rows from a data extension sorted in ascending or descending order (case-sensitive).✅ Yes❌ No
LookupRows()Data ExtensionsReturns an unordered rowset from a data extension (case-insensitive).✅ Yes❌ No
LookupRowsCS()Data ExtensionsReturns an unordered rowset from a data extension (case-sensitive).✅ Yes❌ No
Lowercase()StringReturns the provided string using only lowercase letters.✅ Yes✅ Yes
MD5()EncryptionConverts a string to a 128-bit hexadecimal MD5 hash.✅ Yes❌ No
MicrositeURL()SitesReturns a microsite URL with an encrypted query string.✅ Yes❌ No
MMS_Content_URL()SMSReturns the URL of a content item from an inbound MMS message.✅ Yes❌ No
Mod()MathReturns the remainder after dividing the first parameter by the second parameter.✅ Yes✅ Yes
Msg()SMSReturns the body of an incoming message.✅ Yes❌ No
Multiply()MathReturns the product of two numbers.✅ Yes✅ Yes
Noun()SMSReturns a word from an incoming message based on its position.✅ Yes❌ No
NounsSMSReturns all of the message content after the keyword in an incoming message.✅ Yes❌ No
Now()Date & TimeReturns the current system timestamp.✅ Yes✅ Yes
Output()UtilitiesReturns the result of an AMPscript function.✅ Yes✅ Yes
OutputLine()UtilitiesReturns the result of an AMPscript function followed by a newline character.✅ Yes✅ Yes
ProperCase()StringReturns specified string with the first letter of each word capitalized.✅ Yes✅ Yes
QueryParameter()SitesRetrieves a value from a URL query string.✅ Yes❌ No
RaiseError()UtilitiesRaises an error and stops the processing of an email job.✅ Yes✅ Yes
Random()UtilitiesReturns a random number within a defined range.✅ Yes✅ Yes
Redirect()SitesRedirects landing page visitors to a different URL.✅ Yes❌ No
RedirectTo()HTTPCreates a link using data from an attribute, data extension field, or variable.✅ Yes❌ No
RegExMatch()StringSearches for a pattern in a string using a regular expression.✅ Yes❌ No
Replace()StringReplaces every occurrence of one substring with a different substring.✅ Yes✅ Yes
ReplaceList()StringReplaces one or more substrings with another string.✅ Yes✅ Yes
RequestHeader()HTTPRetrieves the header from an HTTP request for a landing page.✅ Yes❌ No
RequestParameter()SitesReturns the value of a parameter from a form field or landing page URL parameter.✅ Yes❌ No
RetrieveMscrmRecords()Microsoft Dynamics CRMRetrieves data from Microsoft Dynamics CRM entities.✅ Yes❌ No
RetrieveMscrmRecordsFetchXml()Microsoft Dynamics CRMReturns the attributes specified in a Fetch XML query.✅ Yes❌ No
RetrieveSalesforceJobSources()SalesforceReturns a rowset that contains information about a send.✅ Yes❌ No
RetrieveSalesforceObjects()SalesforceReturns a rowset that contains data that matches the criteria you specify.✅ Yes✅ Yes
Row()Data ExtensionsReturns a row from a rowset, array, or object.✅ Yes✅ Yes
RowCount()Data ExtensionsReturns the number of rows in a rowset, array, or object.✅ Yes✅ Yes
SetObjectProperty()APISets a value for an object created by the CreateObject() function.✅ Yes❌ No
SetSmsConversationNextKeyword()SMSSets the keyword in an SMS conversation.✅ Yes❌ No
SetStateMscrmRecord()Microsoft Dynamics CRMSets the state and status of a Microsoft Dynamics CRM record.✅ Yes❌ No
SHA1()EncryptionConverts a string to a 160-bit hexadecimal SHA-1 hash.✅ Yes❌ No
SHA256()EncryptionConverts a string to a 256-bit hexadecimal SHA-2 hash.✅ Yes❌ No
SHA512()EncryptionConverts a string to a 512-bit hexadecimal SHA-2 hash.✅ Yes❌ No
StringToDate()Date & TimeConverts a date string to a .NET datetime object.✅ Yes✅ Yes
StringToHex()StringConverts each character in a string to its hexadecimal equivalent.✅ Yes❌ No
Subtract()MathReturns the result of subtracting the second parameter from the first parameter.✅ Yes✅ Yes
SubString()StringReturns a portion of a string, beginning at a specified character position.✅ Yes✅ Yes
SystemDateToLocalDate()Date & TimeConverts the system time to a local datetime string.✅ Yes❌ No
TransformXml()ContentApply an XSL transformation to XML data.✅ Yes❌ No
TreatAsContent()ContentTreats a string as though it came in from a content area.✅ Yes❌ No
TreatAsContentArea()ContentTreats content from a data extension as though it came from a content area.✅ Yes❌ No
Trim()StringRemoves white space from the beginning and end of a string.✅ Yes✅ Yes
UpdateData()Data ExtensionsUpdates data in a data extension in CloudPages, microsites, landing pages, and SMS messages.✅ Yes❌ No
UpdateDE()Data ExtensionsUpdates data in a data extension in emails.✅ Yes❌ No
UpdateMscrmRecords()Microsoft Dynamics CRMUpdates one or more records in a Microsoft Dynamics CRM entity.✅ Yes❌ No
UpdateSingleSalesforceObject()SalesforceUpdates a record in a Salesforce object.✅ Yes❌ No
UpsertContact()ContactsUpserts attributes into a contact record.✅ Yes❌ No
UpsertData()Data ExtensionsUpserts data in a data extension in CloudPages, microsites, landing pages, and SMS messages.✅ Yes❌ No
UpsertDE()Data ExtensionsUpserts data in a data extension in emails.✅ Yes❌ No
UpsertMscrmRecord()Microsoft Dynamics CRMUpserts a Microsoft Dynamics CRM record.✅ Yes❌ No
Uppercase()StringReturns the provided string using only uppercase letters.✅ Yes✅ Yes
UrlEncode()HTTPModifies a string to include only characters that are safe to use in URLs.✅ Yes❌ No
v()UtilitiesOutputs the value of a variable.✅ Yes✅ Yes
VerbSMSReturns the keyword from an incoming message.✅ Yes❌ No
WAT() and WATP()ContentReturns the values of a Web Analytics Tracking (WAT) parameter.✅ Yes❌ No
WrapLongURL()HTTPReturns a shortened URL when provided with a long URL.✅ Yes❌ No