Execution Context

Execution Context When creating web-based content — either landing pages, Web Collect or Smart Capture forms — the execution context of the page (‘load’ or ‘post’) can be detected by the global, read-only variable @@ExecCtx. The variable...

Marketing Cloud API Functions

Overview These AMPscript functions provide a means for interacting with the Marketing Cloud SOAP API in the context of a microsite page, CloudPage or MobileConnect SMS message. While they are more verbose than the regular AMPscript functions, these API functions do...

Using Variables

Using Variables Variables aren’t required in AMPscript. It’s possible to achieve the same result by just using functions, conditional statements and operators. However, without variables: functions and constants would need to be defined multiple times,...

Script Blocks

Script Blocks Script blocks can also be included within code blocks to whether the containing code should be interpreted. Two attributes can be included in a script block: name and type. Example 1 In the example below, the HTTPGet function will only be executed if the...

AddObjectArrayItem

AddObjectArrayItem This function adds an object to a Marketing Cloud API Object array. Arguments AddObjectArrayItem(1,2,3) Ordinal Type Required Description 1 API Object True The API Object that contains the array 2 String True The array property associated with the...

Comments

Comments Comments can be included in AMPscript blocks. They are contained within an opening /* and closing */ syntax pair and provide the ability to include a readable explanation or annotation for users. Any comments are ignored by Marketing Cloud and will not be...