0

When previewing my email I get the following error message:

An unrecognized expression appears in a script block. Script Expression: < MemberID: XXX JobID: 0

The error appears to be related to the field Lead:Language__c, which I can confirm is listed as a column in the Data Extension. I reviewed the article below that suggested removing the Lead: fixed the issue, but this did not happen for me. The AMPscript is listing below. Also, there are other variables in the email, but the language one is the only one using AMPscript logic. Can anyone spot what I've done wrong here?

AMPscript error in email - Unrecognized expression appears in a script block

%%[
    SET @salutationLanguage = Lead:Language__c, 
    IF @salutationLanguage=="de" or @salutationLanguage=="German" THEN
]%%

Sehr geehrte Damen und Herren

%%[ELSEIF @salutationLanguage=="en" OR @salutationLanguage=="English" THEN]%%

Hello

%%[ELSEIF @salutationLanguage=="sp" OR @salutationLanguage=="Spanish" THEN]%%

Hola

%%[ELSEIF @salutationLanguage=="Dutch" OR @salutationLanguage =="nl" THEN]%%

Hoi

%%[ELSE]%%

Hello

%%[ENDIF]%%,
3
  • these filed is there in your Dataextension or List ?
    – Ravi.A
    Jan 22, 2019 at 9:25
  • @pkharries yes, it's in the data extension Jan 22, 2019 at 11:10
  • You have a stray comma after the SET @salutationLanguage = Lead:Language__c Jan 22, 2019 at 12:21

1 Answer 1

0

try like this

%%[SET @salutationLanguage = Lead:Language__c]%%
%%[ IF @salutationLanguage=="de" or @salutationLanguage=="German" THEN]%%
  Sehr geehrte Damen und Herren
%%[ELSEIF @salutationLanguage=="en" OR @salutationLanguage=="English" THEN]%%
  Hello
 %%[ELSEIF @salutationLanguage=="sp" OR @salutationLanguage=="Spanish" THEN]%%
      Hola
 %%[ELSEIF @salutationLanguage=="Dutch" OR @salutationLanguage =="nl" THEN]%%
     Hoi
    %%[ELSE]%%
       Hello
      %%[ENDIF]%%
2
  • Please update your answer to explain what you updated. Jan 22, 2019 at 12:21
  • thank you for the help @pkharries - your solution worked. :) Jan 29, 2019 at 16:20

You must log in to answer this question.

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