0

Salesforce MC error:

Error 1: Script SET Statement Invalid
An error occurred when attempting to resolve a script expression. See inner exception for detail. Script Expression: Lookup("PUBLIC_SCHOOL_DISTRICT__C_SALESFORCE","Number_of_Community_Interests__c","Id",%%PublicSchoolDistrictId%%)

<div>
    %%[/* Pull the Current CIL count */
    Var @cilCount
    Set @cilCount = Lookup("PUBLIC_SCHOOL_DISTRICT__C_SALESFORCE","Number_of_Community_Interests__c","Id",%%PublicSchoolDistrictId%%)
  ]%%
    Count: %%= v(@cilCount) =%%
    </div>

I'm not sure about my placement within the HTML email. I inserted this code inside the tag.

1 Answer 1

1

Try this:

    %%[
/* Pull the Current CIL count */
    Var @cilCount
    Set @cilCount = Lookup("PUBLIC_SCHOOL_DISTRICT__C_SALESFORCE","Number_of_Community_Interests__c","Id",PublicSchoolDistrictId)
  ]%%
    <div> 
Count: %%=v(@cilCount)=%%
    </div>

The PublicSchoolDistrictId doesn’t need the percentage signs as it’s used inside an AMPscript block. I also removed the spaces around the v function and moved your div further down. AMPscript doesn’t need to be wrapped in HTML (but it can if needed).

2

You must log in to answer this question.

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