Unable to use IF/ELSE statements in SMS Messages within Content Builder
Trailblazer Community

Unable to use IF/ELSE statements in SMS Messages within Content Builder

Marketing Cloud Mobile

Last updated 2021-02-08 ·Reference W-8856654 ·Reported By 0 users

In Review

Summary
When attempting to use IF/ELSE statements in an SMS Message Content Block in Content Builder, the Marketing Cloud will save the message, but it will not save the AMPScript content written in the SMS Message

Repro
- Create an SMS Message in Content Builder
- Use an IF/ELSE statement (example below) in the Message
- Save the Content Block
- Return to the Content Block to notice no content was saved.
==========

Example:

%%[
VAR @ABC, @DEF
SET @ABC = 123

IF @ABC = 123 THEN
]%%

Show me 123

%%[ ELSEIF @ABC = 456 THEN ]%%

Show me 456

%%[ELSE ]%%

Show me something else

%%[ ENDIF ]%%

Workaround
Add the AMPScript Code into a CodeSnippet Content Block and then call the CodeSnippet via the SMS Message instead.

Reported By (0)

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.