I have a separate data extension that includes all of our BAD email data (yes, we should have cleaned this out before importing into SFMC). Is the below code proper syntax for removing all the records from being emailed in the journey using an exclusion script in an email send activity?

rowcount(lookuprows("ENT.Risky_Undeliverable_Joined", "Contact_Key", 
"Contact_Key")) > 0

2 Answers 2


You should consider Auto-Suppression Lists ahead of using exclusion scripts for this purpose. Exclusion scripts depend on users pasting that AMPScript into every send. They'll forget.


Auto-Suppression Lists apply themselves to every send without users having to do anything specific to apply them. They suppress based on the email address, not SubscriberKey. And they have some flexibility in terms if which business units, send classifications or sender profiles they apply to.

They work automagically (almost).

To create a new Auto-Suppression List, go to "Email -> Admin -> Send Management -> Auto-Suppression Configuration". If you do not see this option, please contact your Salesforce Account Executive to have the feature enabled. The page for configuration looks like this:

enter image description here

Auto-Suppression Lists are a bit of a strange beast. They're hidden Data Extensions that don't appear in any of your Data Extension folders. The only way to update them is by import from your Enhanced FTP or by API, but they live in the Data Extensions tab of the Import configuration:

enter image description here

You can query them with Query Activities just like any other Data Extension, though:

    [Email Address],
    [Date Added],
    [Dodgy Emails]

In a Child Business Unit, you can apply them to one or more sender profiles:

enter image description here

Or Send Classification type (Commercial/Transactional):

enter image description here

In the Admin Business Unit, you can apply the Auto-Suppression List in a Global or Selective way along the lines above:

enter image description here

  • In thought, this sounds like a great route, however...I'm not seeing any place within this 'create auto-suppression' where I can select a list, data extension or import. You can bet that adding 350K records to this workflow won't be happening. <br>Good to know where this is though. Commented Jun 15, 2017 at 11:53
  • 2
    Hey @TomCallahan I added a few more details to my response that'll hopefully help.
    – Macca
    Commented Jun 15, 2017 at 12:27

Basically the syntax is correct, however you need to use a variable for the SubscriberKey (I suppose you use a SubscriberKey which is stored in your data extension's "Contact_Key" column). In your proposed exclusion script, you check the value of the "Contact_Key" column against the string "Contact_Key" rather than the key of the subscriber reaching the email activity.

The complete script would then look like this:

ROWCOUNT(LOOKUPROWS("ENT.Risky_Undeliverable_Joined", "Contact_Key", _subscriberKey)) > 0

Further information:

  • #The SFMC documentation on this makes it seem like the "Contact_Key" to "Contact_Key" would work:# italic "Examples: a. ROWCOUNT(LOOKUPROWS("Exclustion_DATA_EXTENSION_NAME","EMAIL_ADDR", EMAIL_ADDR))>0 b. SubscriberKey == 16172 and _SubscriberKey == 15705"_italic In my data model, I have the Contact records key set as "Contact_Key". Commented Jun 14, 2017 at 14:35
  • Sorry about the formatting there Commented Jun 14, 2017 at 14:52
  • I think the contact key is just a synonymous for subscriberkey and the way to read this in the exclusion script is using _SubscriberKey. I don't know if Contact_Key would work too, but if it would you need to remove the quotes so it is evaluated as it would otherwise be the very string "Contact_Key". Commented Jun 14, 2017 at 14:57
  • 1
    At present, Journey Builder emails and exclusion scripts are evaluated in the email send context, making _subscriberKey the right choice (to my knowledge). Would love to hear if anything else is true. Commented Jun 15, 2017 at 12:46

You must log in to answer this question.

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