Suggested answer

AMPscript uses IF condition THEN ... ELSEIF condition THEN ... ELSE ... ENDIF for conditional logic. Conditions use comparison operators (==, !=, >, <) and logical operators (AND, OR, NOT). Example:
%%[
SET @tier = Lookup("Loyalty","Tier","Email",emailaddr)
IF @tier == "Gold" THEN
SET @msg = "Thank you, Gold member!"
ELSEIF @tier == "Silver" THEN
SET @msg = "Thank you, Silver member!"
ELSE
SET @msg = "Thank you for being a member!"
ENDIF
]%%
%%=@msg=%%
ENDIF is mandatory to close every IF block. Nested IFs are supported but can hurt readability.

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.