Have a bit of a complex exclusion requirement and haven't been able to find a script that works.
Background
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)
Goal
The aim is to avoid a contact getting the same up-sell email being sent in another Journey they may have entered. E.g
- 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'.
- 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.