Have a bit of a complex exclusion requirement and haven't been able to find a script that works.


A contact submits a web form for a brochure on a model called 'Pear'. This enters them into a journey called 'Brochure', AND a sendable DE called brochure contacts with data:

  • model (Value = Pear in this eg)
  • EmailAddress
  • Consent
  • DateAdded
  • List item

Have also set up a email send log data extension to capture each email sent to the contact that's been injected into the journey. This DE include fields:

  • SubscriberKey (Primary)
  • EmailID (Email Send ID)
  • model (Value = Pear in this eg)
  • EmailName (Value = brochure request acknowledgement)
  • SendDate (Current)
  • EmailAddress (Email Address in Send)


The aim is to avoid a contact getting the same up-sell email being sent in another Journey they may have entered. E.g

  1. When this contact submitted a form for the brochure of the 'Pear' model, they received the 'acknowledgement' trigger, and was sent an up-sell and a follow up email named 'Pear Tech'.
  2. This contact then submitted a form for a quote on the same model (Pear), received a 'quote acknowledgement' email, but should be excluded from receiving the same 'Pear Tech' email they would have received in the 'brochure' journey. However, if this was a quote for an 'Orange' model, they should receive the 'Orange Tech' up-sell.

Exclusion scripts applied to the Tech Email in both journey's which haven't worked:

ROWCOUNT(LOOKUPROWS("ContactSendLog-UAT", "EmailAddress",emailaddr,"model", AttributeValue("model"),"EmailName","ALM_Tech")) > 0

ROWCOUNT(LOOKUPROWS("ContactSendLog-UAT", "EmailAddress", AttributeValue("EmailAddress"),"model", AttributeValue("model"),"EmailName", AttributeValue("EmailName"))) > 0

ROWCOUNT(LOOKUPROWS("ContactSendLog-UAT", "EmailAddress",emailaddr,"model", AttributeValue("model"))) > 0 AND AttributeValue("EmailName") == "ALM_Tech"

Not sure if it's even possible or if there's a better way to work around this?

P.S All send data are stored in data extensions and not synced with CRM, so journeys are working with individual form submit lists.

  • How is the "ContactSendLog-UAT" updated? Is this a true SendLog and therefor updated automatically at time-of-send. Or is the DE update via contact update activity in your Journey? Commented Sep 26, 2018 at 21:08
  • Also, can you confirm the "model" field in the "ContactSendLog-UAT" contains data? Commented Sep 26, 2018 at 21:09
  • The ContactSendLog is updated via an Upsert into a DE in Ampscript within each email. The model field contains 15 variations.
    – Salvara
    Commented Sep 27, 2018 at 6:12

3 Answers 3


Salvara, here's one solution for you. Albeit, probably not the best.

Add your exclusion script logic to the email and confirm you get the expected results when performing a send preview.

If your unable to get the logic to work from an exclusion script, you can instead have the logic execute in the email and call RaiseError if the exclusion is true.

This should work, but not the best solution because SFMC will charge for the email send in this scenario even though no email was deployed.

  • Hi David, thanks for the suggestion - had looked into this one and think it's definitely good to have on testing what hadn't worked as I couldn't find access to the cases opened on error emails. However found a solution - thank you for the suggestions and food for thought :)
    – Salvara
    Commented Sep 28, 2018 at 9:08

I don't think you'd need an exclusion script to manage this if you're trying to avoid sending someone a specific message in a journey.

I would recommend creating a Data Extension with your Contact Key and a boolean field that designates whether the Contact has received your message or not. Make sure this Data Extension is connected in an Attribute Group in Data Designer so your Journey can see/modify this data.

Then, after a contact receives the message, the next step in the journey is to update the contact and change the evaluation field from FALSE to TRUE.

Each journey can then have a decision split that skips the particular shared email in question.

I think that would work as well or better than an exclusion script, because it might be simpler to understand for non-technical folks.

  • Thanks Matt, it's not so much just the email itself buy the model variant of the email. Trying to exclude the same email, regarding the same model being sent. However if they sign up for a different model, they can receive the same email with a different one.
    – Salvara
    Commented Sep 27, 2018 at 6:14
  • Trying to avoid building out a journey with 15 different email versions and instead use the dynamic email templates.
    – Salvara
    Commented Sep 27, 2018 at 6:16
  • unfortunately unable to access audience builder or groups with data designer. All send lists the submit the webforms are stored in a DE relevant to their form type with retention of 4 weeks. Otherwise, absolutely exclusion lists / groups
    – Salvara
    Commented Sep 27, 2018 at 9:24
  • 1
    Is your 'model' attribute a system profile attribute, or is it a data extension that's been joined in Data Designer? My worry is that the journey won't evaluate anything that's not a system attribute or system profile attribute. Instead of trying to use AttributeValue('model') you might have to do this instead: lookup('brochure contacts','model','emailaddress',emailaddr) Commented Sep 27, 2018 at 15:55
  • Hi Matt - the model attribute is data extension specific. With no access to audience builder, been unable to create any relationships of GroupLine data in Data Designer. But it's all good - have found a solution :)
    – Salvara
    Commented Sep 28, 2018 at 9:06

Thanks all for bouncing ideas. Found this worked on on exclusion scripts across different journeys, using 3 different web forms to collect details into three different sendable data extensions. Would only recommend this for temporary data / not managing contacts via audience builder (which would be optional to have as source of truth).

Updated the ContactSendLog DE to have the fields:

  • SubscriberKey (Primary)
  • EmailID (Latest Email Send ID / Nullable)
  • model (Value = Pear in this eg / Nullable)
  • EmailName (Latest Email Sent Name)
  • SendDate (Current / Nullable)
  • EmailAddress (Email Address in Send / Nullable)
  • EmailMessage1 (Boolean / Nullable)
  • EmailMessage2 (Boolean / Nullable)
  • EmailMessage3 (Boolean / Nullable)

Updated the Exclusion Script to:

LOOKUPROWS("ContactSendLog-UAT", "EmailAddress",emailaddr,"model", AttributeValue("model"),"EmailMessage1",1)

The above script will check if that email address has already been sent the EmailMessage1.

Not using SubscriberKey as the same customer can sign up for a 'brochure' of multiple models, and receive EmailMessage1 for multiple models, but not the same one.

SubscriberKey is also logged as unique for every web form submission SubcriberKey = [email protected] and Email = [email protected].

  • CORRECTION The above line didn't actually work (delayed email send meant the emails meant to have been excluded, came through) This line does work however... Lookup('ContactSendLog_UAT', 'EmailMessage1','EmailAddress',emailaddr,'model', AttributeValue('model'))
    – Salvara
    Commented Oct 2, 2018 at 10:42

You must log in to answer this question.

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