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 categoryCurrently supported?
Marketing Cloud Engagement SOAP API functions🚫 No
Contact model functions🚫 No
Content functions🟡 Partial
Data extension functions🟡 Partial
Date and time functions🟡 Partial
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🟡 Partial
Utility functions🟡 Partial