Skip Navigation

Programmatic Marketing Content

control-j is the search shortcutj
Introduction to Programmatic Marketing Content
AMPscript
Guide Template Language
Guide Template Language Syntax Guide
Tags
Set Delimiters
Built-In Block Helpers
Each
If
Switch
Unless
With
Options
Escape Rendered Content Tag Syntax
Remove Whitespace Tag Syntax
Variables
Content Areas Within Template and Layout
User-Defined Data Sources
Impression Regions
Sections
Partials
Guide Template Language Usage with AMPscript and Server-Side JavaScript
Guide Template Language Workbook
Server-Side JavaScript
Guide Template Language/Guide Template Language Syntax Guide/Built-In Block Helpers/Switch

Switch

The switch block help conditionally renders text while the specified expression remains true. Include an optional else tag as needed:

The Contact will display the appropriate text depending on the value of State.

Salesforce logo