AMPscript Function Reference
Per-function AMPscript reference pages for Marketing Cloud Engagement. Every page is proven by running the function on a live Engagement CloudPage — signature, argument handling, edge cases, and the test script that produced the evidence.
This is the runtime-proven half of the AMPscript reference. Every function in the language catalog is listed below, but only the ones marked Verified have a page. Each of those pages documents one function as it actually behaves on a live Marketing Cloud Engagement CloudPage — what the signature really accepts, what happens on the edges, and the AMPscript that produced the evidence. Nothing on those pages is inferred from reading a doc page.
The Verified badge marks a function that has completed a runtime sweep and has a reference page — its name links there. A name without the badge is listed from the language catalog so the full surface stays browsable, but its runtime behaviour has not been proven here and it has no page yet. Use the AMPscript guidance page and ampscript.guide for those in the meantime.
All functions
Verified means the function completed a runtime sweep on a live Engagement CloudPage and has a reference page — the name links to it. A name without the badge is listed from the language catalog and has not been proven here; use ampscript.guide for those until a sweep reaches them.
| Function | SSJS | Returns | Description |
|---|---|---|---|
Add() Verified
|
— | number |
Computes the sum of two numeric values. |
AddMscrmListMember()deprecated
|
— | void |
Appends a member to a Dynamics CRM list. |
AddObjectArrayItem() Verifieddiffers
|
Platform.Function.AddObjectArrayItem
|
void |
Appends an item to an API object's array property. |
AttachFile()
|
— | void |
Includes a file attachment in the outgoing message. |
AttributeValue() Verified
|
— | string |
Reads an attribute of the current message or page context by name, giving an empty value instead of failing when the name is unknown. The name is matched without regard to case, and system attributes such as the message context resolve on a CloudPage even though no subscriber is involved. |
AuthenticatedEmployeeID() Verified
|
— | string |
Returns the numeric employee ID of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty ID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. |
AuthenticatedEmployeeNotificationAddress() Verifieddiffers
|
— | string |
Returns the notification email address of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty address rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. It is a separate value from AuthenticatedEmployeeUserName() — neither can be derived from the other. |
AuthenticatedEmployeeUserName() Verified
|
— | string |
Returns the login username of the Marketing Cloud user tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty username rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. |
AuthenticatedEnterpriseID() Verified
|
— | string |
Returns the enterprise ID (EID) of the Marketing Cloud account tied to the current context. On a public CloudPage, where nobody is signed in, it still returns a non-empty ID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. Called from a child business unit it reports the parent (enterprise) MID, not the child MID, and it is a different value from AuthenticatedEmployeeID(). |
AuthenticatedMemberID() Verified
|
— | string |
Returns the member ID (MID) of the business unit the code runs on. On a public CloudPage, where nobody is signed in, it still returns a non-empty MID rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. Called from a child business unit it reports that CHILD MID, unlike AuthenticatedEnterpriseID(), which reports the parent (enterprise) MID in the same render. |
AuthenticatedMemberName() Verified
|
— | string |
Returns the display name of the business unit the code runs on. On a public CloudPage, where nobody is signed in, it still returns a non-empty name rather than an empty value, so it cannot be used to tell an authenticated visitor apart from an anonymous one. It is the business unit name as shown in the Marketing Cloud UI — spaces and punctuation included — not a person and not the login username returned by AuthenticatedEmployeeUserName() in the same render. |
BarcodeURL() Verified
|
— | string |
Generates a URL that renders a barcode image from the given value, symbology, width, and height, plus optional formatting. An empty value aborts the page instead of returning an empty result. |
Base64Decode() Verified
|
Platform.Function.Base64Decode
|
string |
Decodes a Base64-encoded string. The decoded bytes are read as UTF-8 unless encoding names another character encoding, and any value that is not well-formed Base64 aborts the page instead of returning an empty or partial result. |
Base64Encode() Verified
|
Platform.Function.Base64Encode
|
string |
Encodes a value as a Base64 string. The bytes encoded are the UTF-8 representation of the input unless encoding names another character encoding. |
BeginImpressionRegion() Verified
|
Platform.Function.BeginImpressionRegion
|
void |
Marks the start of an impression tracking region. The region name must be a literal — a variable argument aborts the page. |
BuildOptionList() Verified
|
— | string |
Builds HTML <option> elements from supplied value/text pairs for use in a <select> dropdown, marking the pair whose value matches the default selection as selected. |
BuildRowsetFromJSON() Verifieddiffers
|
— | rowset |
Parses a JSON string and returns a rowset. |
BuildRowSetFromString() Verified
|
— | rowset |
Splits a delimited string into a single-column rowset. |
BuildRowSetFromXML() Verifieddiffers
|
— | rowset |
Parses an XML string using an XPath expression and returns a rowset. |
Char() Verified
|
— | string |
Returns the character for the given numeric character code. Codes above 255 are not rejected — they resolve to the matching Unicode character. |
ClaimRow() Verifieddiffers
|
— | row |
Atomically claims an unclaimed row in a data extension by setting a key column value. |
ClaimRowValue() Verified
|
— | string |
Atomically claims a row and returns a specific column value from it, or a caller-supplied fallback when no unclaimed rows remain. |
CloudPagesURL() Verified
|
— | string |
Builds the published URL of a CloudPages landing page. Name-value pairs are appended in PAIRS and are folded into a single encrypted query token rather than readable parameters; an odd trailing argument or a page ID that matches no page aborts the page. |
Concat() Verified
|
— | string |
Concatenates two or more string values. |
ContentArea() Verifieddeprecated
|
Platform.Function.ContentArea
|
string |
Inserts a classic content area by its numeric ID. |
ContentAreaByName() Verifieddeprecated
|
Platform.Function.ContentAreaByName
|
string |
Inserts a classic content area by its folder path and name. |
ContentBlockByID() Verified
|
Platform.Function.ContentBlockByID
|
string |
Retrieves and renders a Content Builder content block by its numeric ID. |
ContentBlockByKey() Verified
|
Platform.Function.ContentBlockByKey
|
string |
Retrieves and renders a Content Builder content block by its customer key. |
ContentBlockByName() Verified
|
Platform.Function.ContentBlockByName
|
string |
Retrieves and renders a Content Builder content block by its folder path and name. |
ContentImageByID() Verified
|
Platform.Function.ContentImageByID
|
string |
Returns an HTML img tag for a Content Builder image asset by its numeric ID. A missing image with no fallback aborts the page. |
ContentImageByKey() Verified
|
Platform.Function.ContentImageByKey
|
string |
Returns an HTML img tag for a Content Builder image asset by its customer key. A missing image with no fallback aborts the page. |
CreateMSCRMRecord()deprecated
|
— | string |
Creates a new record in Microsoft Dynamics CRM. |
CreateObject() Verifieddiffers
|
Platform.Function.CreateObject
|
object |
Instantiates a Marketing Cloud SOAP API object for use with Invoke* functions. |
CreateSalesforceObject() Verified
|
— | string |
Creates a new record in a connected Salesforce Sales or Service Cloud object via Marketing Cloud Connect and returns the 18-character ID of the created record. Requires an active Marketing Cloud Connect integration; the field names must be valid API names on the target object, and a fault (unknown object or field) aborts the whole page rather than returning an error value. |
CreateSmsConversation()differs
|
— | boolean |
Initiates an SMS conversation with a contact from within a MobileConnect message. Returns true when a conversation is created inside a MobileConnect message context, and false in any other context (for example a CloudPage or email). The success path cannot be exercised outside a live MobileConnect send. |
DataExtensionRowCount() Verified
|
— | number |
Returns the total number of rows in a data extension. |
DateAdd() Verified
|
— | date |
Adds a whole number of intervals to a date value. Only the five documented units are accepted and every other unit, including seconds and weeks, aborts the page — as does a non-integer amount or a date the engine cannot parse. |
DateDiff() Verified
|
— | number |
Counts how many boundaries of the requested unit lie between two dates, by truncating both to that unit and subtracting — so a 23-hour gap that crosses midnight counts as 1 day, while 23 hours within one day counts as 0. Finer units than the one requested are ignored rather than rounded. |
DateParse() Verified
|
— | date |
Parses a date string into a date value. A string the parser cannot read aborts the page instead of returning a sentinel, and an ambiguous day-first string such as 5/8/2026 is silently read month-first rather than rejected. An offset or GMT marker in the input is honoured and converted to the account time zone. |
DatePart() Verified
|
— | string |
Extracts one component from a date. The hour is reported on a 12-hour clock with no AM/PM indicator, so 19:35 yields 7 and any time at midnight — including a date with no time part at all — yields 12. Month and day come back zero-padded to two digits while hour and minute do not. |
DecryptSymmetric() Verified
|
— | string |
Decrypts a Base64 ciphertext produced by EncryptSymmetric, using the same algorithm, passphrase, salt and initialization vector. |
DeleteData() Verifieddiffers
|
Platform.Function.DeleteData
|
number |
Deletes rows from a data extension matching the specified key column criteria. |
DeleteDE() Verified
|
Platform.Function.DeleteDE
|
number |
Deletes rows from a data extension. Email-context variant of DeleteData. |
DescribeMSCRMEntities()deprecated
|
— | rowset |
Returns a rowset describing all available Dynamics CRM entity types. |
DescribeMSCRMEntityAttributes()deprecated
|
— | rowset |
Returns a rowset of attributes for the specified CRM entity type. |
Divide() Verified
|
— | number |
Divides the first number by the second. |
Domain() Verified
|
— | string |
Returns everything after the first at sign, without validating the address or the domain. A value with no at sign, an empty string and a number all return an empty string. |
Empty() Verified
|
— | boolean |
Returns true when the value is an empty string, an unset variable, or an undeclared variable. Whitespace, the number 0, the string "0" and the string "false" are all treated as present. |
EncryptSymmetric() Verified
|
— | string |
Encrypts a value using symmetric key encryption and returns the ciphertext as Base64. The result is deterministic: the same inputs produce the same ciphertext on every call. |
EndImpressionRegion() Verified
|
Platform.Function.EndImpressionRegion
|
void |
Marks the end of an impression tracking region. |
EndSmsConversation()differs
|
— | boolean |
Ends an active SMS conversation with a contact from within a MobileConnect message. Returns true when the conversation is ended inside a MobileConnect message context, and false in any other context (for example a CloudPage or email). The success path cannot be exercised outside a live MobileConnect send. |
ExecuteFilter() Verifieddiffers
|
— | rowset |
Executes a predefined data filter and returns the resulting rowset. |
ExecuteFilterOrderedRows() Verifieddiffers
|
— | rowset |
Executes a predefined data filter and returns results sorted by a column. |
Field() Verified
|
— | string |
Retrieves the value of a named field from a rowset row. The two-argument form aborts the page when the column is absent; pass the optional third argument as 0 (or false) to get an empty string for a possibly-missing column instead. |
Format() Verifieddiffers
|
— | string |
Formats a number, a date or a string with a .NET format pattern. The third parameter only accepts Date or the empty string; the documented value Number aborts the page. |
FormatCurrency() Verified
|
— | string |
Formats a number as a currency amount for a locale, choosing the symbol, the separators and the symbol position from that locale. Rounding is half-up. |
FormatDate() Verifieddiffers
|
— | string |
Formats a date according to a date pattern, a time pattern and a locale. The two pattern arguments use separate, case-insensitive token sets: in the date pattern mm means month, and minutes are only reachable from the time pattern. |
FormatNumber() Verified
|
— | string |
Formats a number with a standard or custom .NET numeric pattern, optionally for a locale. Rounding is half-up. |
GetJWT() Verified
|
— | string |
Generates a JSON Web Token signed with the supplied inline secret. The payload is passed through verbatim and is only Base64url-encoded, never encrypted. |
GetJWTByKeyName() Verified
|
— | string |
Generates a JSON Web Token using a named encryption key from Key Management. |
GetPortfolioItem()
|
— | string |
Retrieves metadata for a classic portfolio item. |
GetPublishedSocialContent()differs
|
— | string |
Retrieves published social media content by its identifier. |
GetSendTime()
|
— | date |
Returns a send timestamp: by default the time the send completed for the individual subscriber, or with a true argument the job start or publish time. Outside a send context, such as on a CloudPage, it returns the current system time instead of a send time, in every argument spelling. |
GetSocialPublishURL() Verified
|
— | string |
Returns HTML for sharing a content region on a supported social network via Social Forward. Optionally accepts repeating key/value parameter pairs. |
GetSocialPublishURLByName() Verified
|
— | string |
Returns HTML for sharing a content region on a supported social network (identified by name) via Social Forward. Optionally accepts repeating key/value parameter pairs. |
GUID() Verified
|
Platform.Function.GUID
|
string |
Generates a new globally unique identifier. Every call returns a different value, so store the result in a variable when the same identifier is needed twice. |
HTTPGet() Verified
|
Platform.Function.HTTPGet
|
string |
Performs an HTTP GET request and returns the response body. |
HTTPPost() Verifieddiffers
|
Platform.Function.HTTPPost
|
number |
Performs an HTTP POST request and returns the HTTP status code. The response body is written to the optional output variable. |
HTTPPost2() Verifieddiffers
|
— | number |
Performs an HTTP POST and returns the HTTP status code. The response body and the response headers (as a rowset) are written to optional output variables. |
HTTPPostWithRetry() Verifieddiffers
|
— | number |
Posts content to the specified URL with automatic retry logic on failure, and returns the HTTP status code. Similar to HTTPPost2 but adds configurable retries and rescheduling; the response body and headers (as a rowset) are written to optional output variables. |
HTTPRequestHeader() Verifieddiffers
|
— | string |
Returns the value of a specified HTTP request header from the inbound request. |
IIf() Verified
|
— | string |
Returns one of two values based on a boolean expression (inline if). Only a real comparison or a boolean-returning function selects the true branch; a plain string or number always selects the false branch. Only the selected branch is evaluated, so a call that would abort the page is safe in the branch that is not taken. |
Image()deprecated
|
— | string |
Returns an HTML img tag for the Portfolio image matching the specified external key. |
IndexOf() Verified
|
— | number |
Returns the 1-based position of a substring, matching case-insensitively. An undocumented third argument selects which occurrence to locate. |
InsertData() Verifieddiffers
|
Platform.Function.InsertData
|
number |
Inserts a new row into a data extension. |
InsertDE() Verified
|
Platform.Function.InsertDE
|
number |
Inserts a new row into a data extension. Email-context variant of InsertData. |
InvokeCreate() Verifieddiffers
|
Platform.Function.InvokeCreate
|
string |
Calls the SOAP API Create method on the given API object. |
InvokeDelete() Verifieddiffers
|
Platform.Function.InvokeDelete
|
string |
Calls the SOAP API Delete method on the given API object. |
InvokeExecute() Verifieddiffers
|
Platform.Function.InvokeExecute
|
rowset |
Calls the SOAP API Execute method on the given API object and returns the API status code. |
InvokePerform() Verifieddiffers
|
Platform.Function.InvokePerform
|
string |
Calls the SOAP API Perform method on the given API object. |
InvokeRetrieve() Verifieddiffers
|
Platform.Function.InvokeRetrieve
|
rowset |
Calls the SOAP API Retrieve method and returns a rowset of results. |
InvokeUpdate() Verifieddiffers
|
Platform.Function.InvokeUpdate
|
string |
Calls the SOAP API Update method on the given API object. |
IsCHTMLBrowser() Verifieddiffers
|
Platform.Function.IsCHTMLBrowser
|
boolean |
Tests a user agent string for a compact HTML (cHTML) feature-phone browser. Feature-phone agents such as i-mode and KDDI handsets are recognised; modern desktop and mobile agents are not. Only valid in non-sendable content (CloudPages / landing pages), not in sendable email. |
IsEmailAddress() Verifieddiffers
|
Platform.Function.IsEmailAddress
|
boolean |
Checks a value against email address syntax only; it never tests whether the mailbox or domain exists. Surrounding whitespace and a domain without a top-level domain are both rejected. |
IsNull() Verifieddiffers
|
— | boolean |
Returns true only for a genuine null, which in practice means a data extension field with no value. An unset or undeclared variable, an empty string, whitespace and every ordinary value all return false, so this is not a general emptiness test. |
IsNullDefault() Verified
|
— | string |
Returns the value if not null, otherwise returns the default. Outside a Smart Capture form the default is never reached: on a CloudPage every empty-ish input returns the empty string instead, so it cannot be used as a general fallback. |
IsPhoneNumber() Verified
|
Platform.Function.IsPhoneNumber
|
boolean |
Checks a value against the North American Numbering Plan. Dashes, dots, spaces and parentheses are tolerated, but a leading plus sign, any letter, a number outside the plan and a leading country-code digit all fail. |
Length() Verified
|
— | number |
Returns the number of characters in a string. |
LiveContentMicrositeURL()deprecated
|
— | string |
Generates a URL to a microsite page that serves live, dynamic content. |
LocalDateToSystemDate() Verified
|
Platform.Function.LocalDateToSystemDate
|
date |
Converts a date in the time zone configured on the account to the Marketing Cloud system date (Central Time, no daylight saving). The shift is not constant: the local side observes daylight saving, so a summer instant moves one hour further than a winter one. A value the date parser cannot read aborts the page instead of returning a sentinel. |
LongSFID() Verified
|
— | string |
Converts a 15-character case-sensitive Salesforce ID to the 18-character case-insensitive version. |
Lookup() Verified
|
Platform.Function.Lookup
|
string |
Returns a single field value from the first matching row in a data extension. A no-match returns an empty string. |
LookupOrderedRows() Verified
|
Platform.Function.LookupOrderedRows
|
rowset |
Returns a sorted rowset of matching rows from a data extension. |
LookupOrderedRowsCS() Verified
|
— | rowset |
Case-sensitive version of LookupOrderedRows. Returns a sorted rowset of matching rows. |
LookupRows() Verified
|
Platform.Function.LookupRows
|
rowset |
Returns a rowset of all matching rows from a data extension. |
LookupRowsCS() Verified
|
— | rowset |
Case-sensitive version of LookupRows. Returns a rowset of matching rows. |
Lowercase() Verified
|
— | string |
Converts a string to all lowercase characters. |
MD5() Verified
|
Platform.Function.MD5
|
string |
Returns the MD5 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as. |
MicrositeURL() Verified
|
— | string |
Builds a Classic Content microsite URL whose single encrypted query string carries the page reference and any extra name-value pairs. Every call produces a fresh token, so two calls with identical arguments never match. |
MMS_Content_URL()
|
— | string |
Returns the URL of MMS content from an inbound mobile-originated (MO) message. Only usable in MobileConnect. |
Mod() Verified
|
— | number |
Returns the remainder after dividing the first number by the second (modulo). |
Msg()
|
— | string |
Returns the content of an inbound mobile-originated (MO) message. Only usable in MobileConnect. The only accepted argument value is 0. |
Multiply() Verified
|
— | number |
Computes the product of two numeric values. |
Noun()
|
— | string |
Returns a single word that follows the keyword in an inbound mobile-originated (MO) message, by position. Only usable in MobileConnect, chained off Msg(0). |
Nouns()
|
— | string |
Returns all message content that follows the keyword in an inbound mobile-originated (MO) message. Only usable in MobileConnect, chained off Msg(0). Takes no arguments. |
Now() Verified
|
Platform.Function.Now
|
date |
Returns the current system date and time in Central Standard Time, with no daylight-saving adjustment. Every call within one render returns the same instant. |
Output() Verifieddiffers
|
— | void |
Writes the result of a nested function call into the rendered content. A string literal, a bare variable or a number renders nothing at all, without raising an error. |
OutputLine() Verified
|
— | void |
Writes the result of a nested function call into the rendered content, followed by a carriage return and line feed. A string literal, a bare variable or a number renders only the line break. The break is not an HTML line break, so an HTML view keeps everything on one line unless the content sits inside a preformatted element. |
ProperCase() Verified
|
— | string |
Converts a value to proper (title) case. Every letter after the first of a word is forced to lower case, so existing internal capitals are lost. |
QueryParameter() Verified
|
— | string |
Returns the value of a URL query string parameter from the current page request. The name is matched without regard to case, percent-encoded characters arrive decoded, and a name supplied more than once yields the values joined by a comma. |
RaiseError() Verified
|
Platform.Function.RaiseError
|
void |
Raises a runtime error, optionally skipping the current subscriber or returning an API error. Outside a send it is not a graceful abort: on a landing page it discards everything already written and answers the same generic failure any other aborting call gives, with the message nowhere in the response. |
Random() Verifieddiffers
|
— | number |
Returns a random integer between the two specified values (inclusive). Both bounds must be whole numbers; a decimal bound aborts the page. The bounds may be supplied in either order. |
RatingStars()
|
— | string |
Renders a star-rating image using Einstein recommendations data. |
Redirect() Verifieddiffers
|
— | void |
Performs an HTTP redirect to the specified URL. Landing pages only. The response is a 302 whose Location is the supplied value verbatim, and everything written before the call is discarded along with the page body. Not to be confused with RedirectTo, which emits no redirect at all. |
RedirectTo() Verified
|
Platform.Function.RedirectTo
|
string |
Marks a URL held in a variable or field as a tracked email link. It never redirects the current request and never halts the script; outside a tracked send it hands the value straight back. |
RegExMatch() Verified
|
— | string |
Returns the first occurrence of a regular expression match in a string, selected by capture group. Matching is case-sensitive unless the IgnoreCase option is passed. |
Replace() Verified
|
— | string |
Replaces all occurrences of a substring with a new value, matching case-insensitively. The source is scanned once, so text formed by a replacement is not replaced again. |
ReplaceList() Verified
|
— | string |
Replaces every occurrence of each supplied search value with one common replacement value, matching case-insensitively. The search values are applied one after another in the order given, so text produced by an earlier replacement can still be matched by a later one. |
RequestParameter() Verified
|
— | string |
Returns the value of a form post or query string parameter from the current request. The name is matched without regard to case, percent-encoded characters arrive decoded, and a name supplied more than once yields the values joined by a comma. |
RetrieveMSCRMRecords()deprecated
|
— | rowset |
Retrieves records from Dynamics CRM using a simple filter. |
RetrieveMSCRMRecordsFetchXML()deprecated
|
— | rowset |
Retrieves records from Dynamics CRM using a FetchXML query. |
RetrieveSalesforceJobSources() Verified
|
— | rowset |
Retrieves the source records (SourceID, SourceType, IsInclusionSource) that made up the audience of a Salesforce-triggered send, matched by its numeric job ID, and returns them as a rowset. Requires an active Marketing Cloud Connect integration. A job ID with no matching sources returns an empty rowset rather than an error; the function reports nothing about the job status. |
RetrieveSalesforceObjects() Verified
|
— | rowset |
Retrieves records from a connected Salesforce Sales or Service Cloud object via Marketing Cloud Connect and returns them as a rowset. Requires an active Marketing Cloud Connect integration; a call against an unknown object name aborts the page. |
Row() Verified
|
— | row |
Returns a specific row from a rowset by its 1-based index. Index 0 (or any out-of-range index) aborts the page rather than returning an empty row. |
RowCount() Verified
|
— | number |
Returns the number of rows in a rowset. |
SetObjectProperty() Verifieddiffers
|
Platform.Function.SetObjectProperty
|
void |
Sets a property value on a Marketing Cloud API object. |
SetSmsConversationNextKeyword()differs
|
— | boolean |
Sets the keyword for the next path of an existing SMS conversation, applied when the contact next replies. Does not create a new conversation. Returns true when set inside a MobileConnect message context, and false in any other context (for example a CloudPage or email). The success path cannot be exercised outside a live MobileConnect send. |
SetStateMscrmRecord()deprecated
|
— | void |
Sets the state and status of a Dynamics CRM record. |
SHA1() Verified
|
— | string |
Returns the SHA-1 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as. |
SHA256() Verified
|
— | string |
Returns the SHA-256 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as. |
SHA512() Verified
|
— | string |
Returns the SHA-512 hash of the input value. The bytes hashed are the UTF-8 encoding of the input unless charSet names another encoding, and a number or date argument is hashed as the text it renders as. |
StringToDate() Verified
|
— | date |
Converts a date string to a date value. Behaves identically to DateParse for every input format tested, but takes no second argument, so DateParse is the only one of the two that can return the instant in UTC. A string the parser cannot read aborts the page instead of returning a sentinel, and an ambiguous day-first string such as 5/8/2026 is silently read month-first rather than rejected. |
StringToHex() Verified
|
— | string |
Converts a string to its hexadecimal representation. The bytes rendered are the UTF-8 encoding of the input unless charSet names another encoding. |
Substring() Verified
|
— | string |
Extracts a portion of a string starting at the given index for the specified length. A start position below 1 is treated as the first character. |
Subtract() Verified
|
— | number |
Computes the difference between two numeric values. |
SystemDateToLocalDate() Verified
|
Platform.Function.SystemDateToLocalDate
|
date |
Converts a Marketing Cloud system date (Central Time, no daylight saving) to the time zone configured on the account. The shift is not constant: the local side observes daylight saving, so a summer instant moves one hour further than a winter one. A value the date parser cannot read aborts the page instead of returning a sentinel. |
TransformXML() Verified
|
— | string |
Transforms an XML document using an XSLT stylesheet. |
TreatAsContent() Verified
|
Platform.Function.TreatAsContent
|
string |
Evaluates a string as AMPscript content, rendering any embedded AMPscript expressions, and returns the rendered string. Plain text and the empty string pass through unchanged. |
TreatAsContentArea() Verified
|
— | string |
Stores a content string under a key for the duration of a send and renders it, evaluating any embedded AMPscript. An optional third argument names an impression region. |
Trim() Verified
|
— | string |
Removes leading and trailing whitespace from a value. Tabs, line breaks and the non-breaking space count as whitespace. |
UpdateData() Verifieddiffers
|
Platform.Function.UpdateData
|
number |
Updates existing rows in a data extension that match the specified search columns. Returns the number of rows updated. |
UpdateDE() Verified
|
Platform.Function.UpdateDE
|
number |
Updates existing rows in a data extension. Email-context variant of UpdateData. Returns the number of rows updated. |
UpdateMSCRMRecords()deprecated
|
— | number |
Updates one or more records in a Microsoft Dynamics CRM entity, and returns the number of successfully updated records. |
UpdateSingleSalesforceObject() Verified
|
— | number |
Updates a single record in a connected Salesforce Sales or Service Cloud object via Marketing Cloud Connect. Accepts one or more field name and value pairs. Returns 1 on success; per the official reference it returns 0 on failure, but on a CloudPage a failed update (unknown object, malformed or non-existent record ID) instead surfaces the SOAP fault as an uncatchable page abort rather than returning 0. |
Uppercase() Verified
|
— | string |
Converts a string to all uppercase characters. The German sharp s remains unchanged rather than expanding to SS. |
UpsertContact() Verified
|
— | number |
Upserts attributes onto a mobile contact matched by phone number. If the contact exists it is updated; otherwise a new contact is created. Returns a status code: 0 when the upsert succeeds and 1 when an error occurs. The only supported channel is 'mobile' and the only supported match attribute is 'phone'. An unknown attribute name returns the error status without writing anything. |
UpsertData() Verifieddiffers
|
Platform.Function.UpsertData
|
number |
Updates a row in a data extension if matching columns and values are found, or inserts a row if no matches are found. Returns the number of rows affected. |
UpsertDE() Verified
|
Platform.Function.UpsertDE
|
number |
Updates or inserts a row in a data extension. Email-context variant of UpsertData. Returns the number of rows affected. |
UpsertMSCRMRecord()deprecated
|
— | string |
Upserts a Microsoft Dynamics CRM record. Updates the matched record or creates one if no match is found. Returns the GUID of the record. |
URLEncode() Verified
|
Platform.Function.UrlEncode
|
string |
URL-encodes a string for safe inclusion in a URL. By default only the part after a question mark is touched, so a value that is not a URL passes through unchanged unless the third argument is switched on. |
v() Verified
|
— | string |
Outputs a value inline, normally a variable reference. A string or number literal and a nested function call are accepted as well, each rendering its own value. |
Verb()
|
— | string |
Returns the keyword (verb) from an inbound mobile-originated (MO) message. Only usable in MobileConnect, chained off Msg(0). Takes no arguments. |
WAT()
|
— | string |
Returns the values of the Web Analytics Tracking (WAT) parameter set with the specified external key, substituting the supplied values for the matching WATP references in the Sender Profile tracking parameter. |
WATP()
|
— | string |
Ordinal placeholder for a parameter value configured in a WAT parameter set. The ordinal maps to the position of the value passed to the WAT function. Configured by Marketing Cloud Support as part of the WAT string. |
WrapLongURL() Verifieddiffers
|
— | string |
Shortens a long URL for email clients that truncate long hyperlinks. Outside an email send the argument comes back unchanged, so a CloudPage never sees a shortened link. |
Related
- Differs from official docs (Engagement) — the findings where runtime behaviour contradicts or outruns the official reference
- AMPscript guidance — patterns and snippets rather than per-function reference
- ampscript.guide — the community AMPscript reference, useful for functions not yet verified here
- ssjs.guide — the equivalent runtime-verified reference for Server-Side JavaScript