Forked from wvpv/SFMC-AMPscript-exclusion-script-content-block.amp
Created
December 22, 2022 12:42
-
-
Save ttntm/02a6bb08664e07ceb8536530b46d4b8d to your computer and use it in GitHub Desktop.
Exclusion Script Content Block - Prevent duplicates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
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