0

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)=%%
2

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"
    end

]%%
%%=properCase(@name)=%%

Reference:

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.