DeleteDE

This function deletes rows in a Data Extension that exactly match the specified column name and value pairs. No output results from the use of this function.

NOTE: This function only works in an email. Use DeleteData if you need to delete rows from a Data Extension in a landing page, microsite page or CloudPage, or in an SMS message in MobileConnect.

Arguments

DeleteDE(1,2,3,[4a,4b])

Ordinal Type Required Description
1 String True Data Extension from which to delete rows
2 String True Name of the column that identifies the row to delete
3 String True Value that identifies the row to delete
4a String False Additional column name that identifies the row to delete (see note)
4b String False Additional value that identifies the row to delete (see note)

NOTE: Additional pairs of columns and values can be appended as arguments.

Example 1

The following illustrates the use of this function with the minimum number of arguments.

Data Extension: LoyaltyMembers

Name Data Type Length Primary Key Nullable Default Value
EmailAddress EmailAddress 254 N N
SubscriberKey Text 254 Y N
FirstName Text 50 N Y
LastName Text 50 N Y
Created Date N Y Current Date

The LoyaltyMembers Data Extension includes these rows:

EmailAddress SubscriberKey FirstName LastName Created
[email protected] 8473 Doug Smith 2017-10-21 12:01
[email protected] 5497 Suzy Jackson 2017-10-20 11:01
[email protected] 7114 Dale Cameron 2017-10-19 10:01

Here is an example utilizing the preceding context:

%%[

var @lookupValue

set @lookupValue = AttributeValue("emailaddr") /* value from attribute or DE column in send context */
set @lookupValue = "[email protected]" /* or a literal value */

DeleteDE("LoyaltyMembers","EmailAddress", @lookupValue)

]%%

Output

After the operation, the LoyaltyMembers Data Extension includes these rows:

EmailAddress SubscriberKey FirstName LastName Created
[email protected] 8473 Doug Smith 2017-10-21 12:01
[email protected] 7114 Dale Cameron 2017-10-19 10:01

Example 2


Not a subscriber? Subscribe now.