0

We started sending our birthday emails this month however on March 11th, the ampscript

%%Last Name%%

suddenly didn't work and was displaying on the email. Isnt this supposed to be blank if null?

2 Answers 2

4

If you don't want your email to blow up if the attribute doesn't exist as a Profile Attribute or column in your sending Data Extension:

%%[/* Modify to view AMPScript <div style="display:none"> */

var @lastName
set @lastName = AttributeValue("Last Name")

/*</div>*/
]%%

<!-- some other HTML -->

%%=iif(not empty(@lastName), properCase(@lastName),"Partner")=%%
3
  • Hi @adamspriggs, Thanks! you are right. someone update our profile attributes so the ampscript was treated as text.
    – sforce
    Commented Mar 23, 2017 at 3:02
  • 1
    AttributeValue is one of my favorite AMPScript functions now thanks to @AdamSpriggs Commented Mar 23, 2017 at 12:40
  • 2
    @Gortonington, Yes it's mine too, thanks to Adam, of course! Commented Mar 23, 2017 at 12:57
2

Also, if you have a space in your personalization string, you need to use square brackets:

%%[Last Name]%%

AMPScript Language Elements

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .