Examples:
1. Basic script checking if email address exists in a referenced data extension:
ROWCOUNT(LOOKUPROWS("Exclusion_DATA_EXTENSION_NAME","EMAIL_ADDR_FIELD_NAME", EMAILADDR))>0
In this example, the 'Exclusion_Data_Extension_Name' contains a field titled 'Email_Addr_Field_Name' and this field contains email address values. The Personalization String 'emailaddr' captures the subscribers email address who is being rendered for the send. This will be determined by your Default Email Address within the Journey. If your subscriber email address can be matched to an 'Email_addr_field_name' value in the 'Exclusion_Data_Extension_name' data extension, then a value of 1 is returned through the RowCount(LookUpRows()) functions.
Since 1 is greater than 0, the contact would return a value of true and your contact would be excluded from the send.
2. Exclusion script using OR condition to check multiple data extensions:
(ROWCOUNT(LOOKUPROWS("Exclusion_DATA_EXTENSION_NAME_1", "EMAIL_ADDR_FIELD_NAME", EMAILADDR)) > 0)
OR
(ROWCOUNT(LOOKUPROWS("Exclusion_DATA_EXTENSION_NAME_2", "EMAIL_ADDR_FIELD_NAME", EMAILADDR)) > 0)
3. Exclusion script that that uses AMPscript in a Code Snippet:
The following code is added to a Code Snippet in Content Builder:
%%[
set @count = ROWCOUNT(LOOKUPROWS("Exclusion_DATA_EXTENSION_NAME","EMAIL_ADDR_FIELD_NAME", EMAILADDR))
]%%
%%=v(@count)=%%
The following exclusion script is then used to output the result from the Code Snippet:
ContentBlockbyId("CODE_SNIPPET_ID") > 0
Caution: Complex filters and/or filters on large tables can cause slow send speeds. Best practice is to pre-filter these subscribers before injecting them into the journey in question. If that cannot be achieved, suppression lists would be a preferred alternate to complex exclusion scripts.
Note: Exclusion Script may not be available as an option within the Email Activity. If this is the case, please reach out to Marketing Cloud Support to enable this feature.
000384149

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.