Programmatic Languages35% of the exam

AMPscript delimiters, variables and core functions

Inline, block and tag-based AMPscript syntax, variables, comments and case rules, positional parameters, conditions, the output functions, and the string, date, math and null-test functions that code-reading questions use.

Official exam objective
Given a scenario, demonstrate knowledge of AMPscript and SSJS language syntax and functions.

~7 min read · 14 practice questions ·

What the exam expects

  • Read inline, block and tag-based AMPscript, and spot code that breaks the delimiter, declaration or comment rules.
  • Pass function parameters in the documented order, including skipping an optional parameter.
  • Evaluate conditions built from comparison, and, or and not operators, and trace If, ElseIf and Else branches.
  • Predict exactly what string, date, math, output and null-test functions return in a snippet.
  • Know when TreatAsContent() is needed to render personalization strings stored as data.
  • Key terms: inline AMPscript (%%= =%%, one function, nesting allowed); code block (%%[ ]%%, many statements); tag-based syntax (<script runat="server" language="ampscript">); positional parameter (an argument identified only by its place in the call).

Key facts

Inline limit
Detail
One function per inline section; nesting allowed
Closing a block
Detail
Same delimiter type that opened it
Script tag default language
Detail
JavaScript, unless language="ampscript"
Declaring variables
Detail
Blocks only; a new variable is null
Comments
Detail
/* */ in blocks and script tags, never inline
Skipping an optional parameter
Detail
Pass null or "" in its position
Else per If block
Detail
Only one; ElseIf can repeat
Output() with a literal
Detail
Returns an error
OutputLine() break
Detail
CRLF, so HTML shows one line
IndexOf() not found
Detail
Returns 0; positions are 1-based
Empty() vs IsNull()
Detail
Empty catches null and ""; IsNull only null
Sources for this section (13)
  • When does a variable declared with Var hold null?
  • Why does a <script runat="server"> tag with no language attribute run as SSJS?
  • What does FormatDate() return when you pass it only a date string?
  • Which input types can an If condition evaluate?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Marketing Cloud Engagement Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 25 lessons of the Marketing Cloud Engagement Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (14 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Choose guide-only, practice-only, or save $4 with both

Practice for the Marketing Cloud Engagement Developer exam