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

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. – Tom Callahan Apr 5 '18 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)=%%,

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.