Created
          February 27, 2020 22:11 
        
      - 
      
- 
        Save wvpv/4c63402feb5004d7614f6f1c57620332 to your computer and use it in GitHub Desktop. 
    Exclusion Script Content Block - Prevent duplicates
  
        
  
    
      This file contains hidden or 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