Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ttntm/02a6bb08664e07ceb8536530b46d4b8d to your computer and use it in GitHub Desktop.
Save ttntm/02a6bb08664e07ceb8536530b46d4b8d to your computer and use it in GitHub Desktop.
Exclusion Script Content Block - Prevent duplicates
%%[
var @contextInsertDate
set @contextInsertDate = AttributeValue("YOUR_TSD_DE_INSERT_DATE")
set @contextInsertDate = format(@contextInsertDate,"yyyyMMddhhmmss")
var @exclude
set @exclude = 0
var @rows
var @rowCount
set @rows = LookupOrderedRows("YOUR_TSD_DE", 1, "YOUR_TSD_DE_INSERT_DATE", "YOUR_KEY_VALUE_FOR_SUBSCRIBER_SEND", AttributeValue("YOUR_KEY_VALUE_FOR_SUBSCRIBER_SEND"))
set @rowCount = rowcount(@rows)
if @rowCount > 0 then
set @row = row(@rows, 1)
set @oldestInsertDate = field(@row, "YOUR_TSD_DE_INSERT_DATE")
set @oldestInsertDate = format(@oldestInsertDate, "yyyyMMddhhmmss")
if @oldestInsertDate != @contextInsertDate then
set @exclude = 1
endif
output(concat(@exclude))
endif
]%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment