Trying to write ampscript for an email in Marketing Cloud.

Basically, if the field in the data extension is either empty OR "Friend", then "Dearest Ten" should display.

Below is what I have so far. I need help with the if else statement for the second condition.

    var @name
    Set @name = account_display_name

%%=IIF(Empty(@name),"Dearest Ten",@name)=%%

1 Answer 1


An inline if won't work too well in your scenario. You could do it with the full conditional statement. Something like this:


    var @name
    Set @name = AttributeValue("account_display_name")

    if empty(@name) or @name == "Friend" then 
      set @name = "Dearest Ten"
    elseif @name == "Stranger Things" then
      set @name = "Dearest Eleven"



You must log in to answer this question.

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