AMPscript Core Extension for Visual Studio Code

Salesforce Labs has created the AMPscript Core extension for Visual Studio Code (VS Code). This extension provides AMPscript developers with several benefits, including syntax highlighting for AMPscript code. The extension can also create a server on your local computer that provides a live preview of your rendered HTML and AMPscript code.

The AMPscript Core extension is a community-supported project, not an official Salesforce product. Salesforce Support can’t assist with this extension. The extension uses the Apache License, version 2.0.

The AMPscript Core extension for VS Code includes several capabilities:

  • AMPscript syntax highlighting.
  • A server that runs on your computer, providing a live preview of HTML and AMPscript content in your browser.
  • The ability to test data extension functions using local .csv files.

The extension supports the majority of AMPscript keywords and syntactical elements.

ElementExampleCurrently Supported?
Inline AMPscript%%=...=%%✅ Yes
AMPscript blocks%%[...]%%✅ Yes
AMPscript tag syntax<script language="ampscript"> ... </script>✅ Yes
AMPscript variables@varName✅ Yes
Logical operators==, >=, <=, !=✅ Yes
LoopsFor @counter = 1 to @repetitions do ...✅ Yes
If statementsIf @value == 42 then ...✅ Yes
System time & date stringsxtlongdate, xtyear, xtmonth🚫 No
System sender and recipient variables_emailaddr, _fullname, replyname🚫 No

The extension supports AMPscript functions that are commonly used to personalize messages and evaluate conditions.

Function categorySupported?Notes
Marketing Cloud Engagement SOAP API functions🚫 No
Contact model functions🚫 No
Content functions🟡 PartialThe extension can’t retrieve content from your Marketing Cloud Engagement account, but it can use data from files stored on your computer.
Data extension functions🟡 PartialThe extension can’t retrieve data extensions from your Marketing Cloud Engagement account, but it can retrieve data from CSV files stored on your computer.
Date and time functions🟡 PartialThe extension can’t retrieve information from your Marketing Cloud Engagement account, such as the timestamp for the beginning of a send.
Encryption functions🚫 No
HTTP functions🚫 No
Math functions✅ Yes
Microsoft Dynamics CRM functions🚫 No
Sales and Service Cloud functions🚫 No
Site functions🚫 No
SMS functions🚫 No
Social functions🚫 No
String functions🟡 PartialStringToDate() and StringToHex() functions aren’t available.
Utility functions🟡 PartialThe extension can’t interact with your Marketing Cloud Engagement account. For example, you can’t use the RaiseError() function to cancel an email send.