2

I am assisting with a MC project and am having conceptual issues with platform when it comes to exclusion scripts.

When in a Journey and you have a "Send Email" action open there is a "Exclusion Script" text input for excluding records.

The script I want to exclude is pretty straight forward

(NOT(ISNULL(EXPDAT)) && EXPDAT <= NOW()) || 
Comm_Preferences == "No" || 
(NOT(ISNULL(DSS_End)) && DSS_End <= NOW())

When I Activate the Journey I get an error

ISNULL(EXPDAT) Attribute or Field Name: EXPDAT Invalid Content

I also have this script saved as a DataExtension and saw a post about linking the data extension to the email action, but I'm not understanding how that "link" works.

(ROWCOUNT(LOOKUPROWS("ExclusionDE", "EmailAddress", Email_Address)) > 1)

I've never worked on MC and appreciate any advice.

1

The EXPDAT, Comm_Preferences and DSS_End are Profile Attributes or (more likely) Data Extension columns that are in the send context for your message. If any one of those do not exist when pairing the audience and your message, you'll get an error like the one you described.

Same thing in the second example. The email_address is a DE column or Profile Attribute and must exist in order for the AMPScript to evaluate.

The remedy is to ensure that the entry event Data Extension (or API call) for your Journey includes these fields/columns.

An alternative is to use the AttributeValue() function which will return an empty string if the attribute/column doesn't exist:

(NOT(ISNULL(AttributeValue("EXPDAT"))) && AttributeValue("EXPDAT") <= NOW()) 
|| AttributeValue("Comm_Preferences") == 'No" 
|| (NOT(ISNULL(AttributeValue("DSS_End"))) && AttributeValue("DSS_End") <= NOW())

In the second script you can fall back to using the emailaddr personalization string, which exists for every email send:

(ROWCOUNT(LOOKUPROWS("ExclusionDE", "EmailAddress", emailaddr)) > 1)
  • Hi Adam! Thanks for responding. I was able to activate the Journey, but now the records are not receiving emails. I have checked that the records DO NOT match the exclusion criteria. Do you have any idea why they would not send? Thanks! – TemporaryFix Mar 12 '18 at 20:46
  • Can you update your question and include details about your entry event data extension (or method) -- like field names and types? – Adam Spriggs Mar 12 '18 at 22:08
  • We figured it out. You guided us in the right direction. We had to use (ROWCOUNT(LOOKUPROWS("ExclusionDE", "EmailAddress", AttributeValue("EmailAddress"))) > 1) – TemporaryFix Mar 13 '18 at 17:06

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.