To help you coding with AMPscript for Salesforce Marketing Cloud : as you type get proposed system strings and other functions.
How to ?
Prerequisite : having the AMPscript syntax highlighting extension
When start typing the AMPscript functions and system strings names, press enter to auto-complete your code
Press cmd + shift + p and then >insert snippet to review all the snippets available. Press enter to insert one
4.When previewing the snippets, click on i to see the whole description of the different functions
Tips 💡
When editing and AMPscript (.amp file or with AMPscript Syntax), type:
code to insert an code block
comment to insert
if to have basic if statement options
for loop to have a sample of loop
Release Notes
1.0.4
Initial release
1.0.5
Updated Readme file
1.0.6
Bug fixing (typos)
1.0.7
added better description for functions
added new functions (Microsoft CRM, API and a few others...)
added a snippet called: code block AMPscript
%%[
]%%
added a snippet called: for loop
%%[
set @lookupDeRows = lookuprows("MyDe","SomeField","SomeValue")
set @nbLookupDeRows = rowcount(@lookupDeRows)
for @i = 1 to @nbLookupDeRows DO
set @loopDeRow = row(@lookupDeRows,@i)
set @someField1 = field(@loopDeRow,"someField1")
set @someField2 = field(@loopDeRow,"someField2")
]%%
%%=v(@someField1)=%%<br>
%%=v(@someField1)=%%<br>
%%[next @i]%%
added a snippet called: if elseif inline statement
%%[
]%%
added a snippet called: if elseif statement for external blocks
%%[if @myvar == "this" then]%%
/* do this */
%%[elseif @myvar == "that" then]%%
/* do that */
%%[else]%%
/* do nothing */
%%[endif]%%
added a snippet called: if contains inline statement
%%[
/* Set the value to check */
Set @Value= "Indianapolis"
/* Set the string to check */
Set @String = "Welcome to Indianapolis, we hope you enjoy your stay!"
/* Does it match; ; if no match, output of IndexOf(1,2) will be "0" */
if IndexOf(@String,@Value) > 0 then
Set @Output = "How was your stay in Indianapolis"
else
Set @Output = "Where would you like to stay?"
endif
]%%
added a snippet called: if empty inline statement
%%[
if @myvar == "this" then
/* do this */
elseif @myvar == "that" then
/* do that */
else
/* do nothing */
endif
]%%
added a snippet called: hidden code block AMPscript