Find your content:

Search form

You are here

Rows in Data Extension Not being deleted

 
Share

I have TriggerSend that I call using the web api.

in the Email there is AMPScript

A section of that AMPScript is suppose to clear data from named Data Extensions. However, no rows are ever removed.

here is the code:

if Not Empty(@order_id) then
    DeleteDE("order", "order_id", @order_id)
    DeleteDE("order_product", "order_id", @order_id)
    DeleteDE("order_shipping", "order_id", @order_id)
endif

A few things.

I know for a fact that @order_id has a value, because in the body of the email, I echo out the value

Your Order id is #%%=v(@order_id)=%%

which correctly displays the order value.

However, even though the email is sent, and the order value in the email body is correct, and points to rows in the DE that contain that order id, they are not deleted.

Can someone please help me with this issue?


Attribution to: Question

Possible Suggestion/Solution #1

@Mac was able to identify the problem.

...Could it be an issue where that AMPScript was added to the email after the triggered send was published so it needs to be published again for those changes to work?

The issue was, that after making chances to my Email located at

Content > My Emails > Store > Receipt

I simply Validated the email, and Saved it. With the misconception that the changes I make here, will automatically update the TriggerSend as well.

However, it turns out, if you have a TriggerSend defined, and you change the email it is pointing it to, you have to go back to that same trigger:

Interaction > Messages > Trigger Sends > [your trigger]

select it, and click Publish Changes

It is now my understanding, that the Trigger does not point to directly to the email that was select when you created it, but rather a copied version of it.

The reason for this, is to allow you to edit the email directly, without the need to pause the TriggerSend. Since any edits you make, would require at least some validation and testing, before you'd want to make them live.


Attribution to: Question
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/31119

My Block Status

My Block Content