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]%%,
  • these filed is there in your Dataextension or List ? – pkharries Jan 22 '19 at 9:25
  • @pkharries yes, it's in the data extension – Greg Beazley Jan 22 '19 at 11:10
  • You have a stray comma after the SET @salutationLanguage = Lead:Language__c – Adam Spriggs Jan 22 '19 at 12:21
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]%%
| improve this answer | |
  • Please update your answer to explain what you updated. – Adam Spriggs Jan 22 '19 at 12:21
  • thank you for the help @pkharries - your solution worked. :) – Greg Beazley Jan 29 '19 at 16:20

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.