Runtime verified Test scripts included

Syntax

DeleteDE(dataExt, columnName1, valueToDelete1[, columnNameN, valueToDeleteN, ...])  →  string

Parameters

Name Type Required Description
dataExt string Yes Name or external key of the data extension to delete from
columnName1 string Yes First column to match on
valueToDelete1 string | number Yes Value the first column must equal
columnNameN string No Further match columns, each paired with a value
valueToDeleteN string | number No Value for the corresponding further column

Example

%%[
  DeleteDE("AMP_VERIFY_SCRATCH", "Id", "Y1")
]%%

Renders nothing — DeleteDE returns an empty string. Reading back in a later render confirms the row is gone: rows=[0].

A realistic use removes a row inside a send:

%%[
  DeleteDE("PendingQueue", "SubscriberKey", _subscriberkey)
]%%

Return value

string — always an empty string, so nothing is emitted. This is the only runtime difference from DeleteData, which returns the deleted-row count. Use the *DE family inside email sends; use the *Data family on CloudPages.

Behaviour

Ordered column/value match pairs. Arguments after dataExt are read as column, value, column, value, … — identical to DeleteData; the families differ only in the return value.

A no-match is a silent no-op — no error, no abort, nothing deleted.

Deletes are visible immediately to fresh reads. Confirm with RowCount(LookupRows(...)) in a subsequent render; the AMPscript within-render read cache means a row read earlier in the same render may still appear until the render ends.

Show test script
%%[
  VAR @b, @r
  SET @b = RequestParameter("b")

  IF @b == "zzz" THEN
    OutputLine(Concat("CTRL=[alive]"))
  ENDIF

  IF @b == "safe" THEN
    InsertData("AMP_VERIFY_SCRATCH", "Id", "Y1", "FirstName", "Yara", "Score", 2)
    SET @r = DeleteDE("AMP_VERIFY_SCRATCH", "Id", "Y1")
    OutputLine(Concat("DeleteDE ret=[", @r, "]"))
  ENDIF

  IF @b == "read" THEN
    OutputLine(Concat("Y1 rows=[", RowCount(LookupRows("AMP_VERIFY_SCRATCH", "Id", "Y1")), "]"))
  ENDIF
]%%

Availability

Platform Available
Marketing Cloud Engagement Yes
Marketing Cloud Next No

See also