1

I want to show a default value "Friend" if firstname is Empty or unknown And it should show the name if it is there. But this is not working. Can anyone help me this.

%%[var @Firstname, @Email 
set @Email = EmailAddress
set @Firstname = lookup("Salutation_DE","Firstname","EmailAddress", @Email)]%%  

%%[IF Empty(@Firstname) OR @Firstname == "Unknown" THEN]%%
set @Firstname = "Friend" 
%%[ENDIF]%%

Dear %%=v(@Firstname)=%%

2 Answers 2

5

Try this?

%%[
IF Empty(@Firstname) OR @Firstname == "Unknown" THEN
 set @Firstname = "Friend"
ENDIF
]%%

Dear %%=v(@Firstname)=%%

1
  • That should be it. @r suri you closed your ampscript bracket too early. Commented Apr 5, 2018 at 14:24
1

Thanks for the response!! That was a silly mistake of data error.

Below is the code:

%%[ IF Empty(@Firstname) OR @Firstname == "Unknown" THEN 
set @defaultValue = "Friend" 
Else
set @defaultValue = @Firstname
Endif]%%

Dear %%=v(@defaultValue)=%%,

You must log in to answer this question.

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