AMPscript Core is an open source implementation of the Marketing Cloud AMPscript language.
It is cross platform and works on Windows, macOS and Linux.
Subscriber attributes %%Foo%%/[Foo] are supported through a JSON file named subscriber.json in the working directory.
Supported within the JSON file is a key/value pair of the attribute name and value.
Example:
{
"FirstName": "Logan"
}The attribute values can be referenced via:
%%[
SET @FIRSTNAME = [FirstName]
]%%
Hello %%=V(@FIRSTNAME)=%%
or
Hello %%FirstName%%
Content functions can reference content local on disk. The files must exist in a Content subdirectory of the working directory.
Example, if you have a file at Content\EmbeddedContent.ampscript, then you can reference it via:
%%=CONTENTBLOCKBYNAME("EmbeddedContent")=%%
Data Extension support is provided through CSV files on disk. The files must exist in a DataExtensions subdirectory of the working directory. The CSV file must contain headers which represent the columns.
Example, if you have a file at DataExtensions\Loyalty.csv, then it will use this CSV file as the data extension.
DataExtensions\Loyalty.csv
EmailAddress,SubscriberKey,FirstName,LastName,LoyaltyLevel
donnie@northerntrailoutfitters.com,1,Donnie,Stanton,Silver
Index.ampscript
Hello %%=LOOKUP("Loyalty", "FirstName", "emailAddress", "donnie@northerntrailoutfitters.com")=%%
Outputs:
Hello Donnie
| Language | Summary |
|---|---|
| AMPscript | |
| SSJS | ⛔ Not supported |
| GTL | ⛔ Not Supported |
| Feature | Summary |
|---|---|
Ampscript Blocks %%[]%% |
✔️ |
| Variables | ✔️ |
For for |
✔️ |
If if |
✔️ |
Logic Operators ==, !=, &&, etc |
✔️ |
Inline Ampscript %%= =%% |
✔️ |
Personalization Strings [Foo] or %%Foo%% |
✔️ |
Tag Syntax <script language="ampscript"> |
⛔ Not Supported |
System Strings xtmonth, jobid, subscriberkey, etc |
⛔ Not Supported |
If the function isn't listed here, then it's not supported.
| Function Area | Supported / Notes |
|---|---|
| Marketing Cloud API | ⛔ Not Supported |
| Contact Model | ⛔ Not Supported |
| Content | |
| Data Extensions | |
| Date and Time | |
| Einstein | ⛔ Not Supported |
| Encryption | ⛔ Not Supported |
| HTTP | ⛔ Not Supported |
| Math | ✔️ |
| Microsoft Dynamics | ⛔ Not Supported |
| Sales and Service Cloud | ⛔ Not Supported |
| Site | ⛔ Not Supported |
| Social | ⛔ Not Supported |
| String | |
| Utility | |
| Content Syndication | ⛔ Not Supported |
- Increase supported feature
- SSJS & GTL
- Static code analysis tools to identify and remediate performance or security issues