1

I have created automation with the following attributes:

  1. file drop

  2. Import the data to DE from the CSV file (Which I have dropped on FTP client)

  3. Send Email activity (Sends the email to that person whose data has been uploaded to DE)
  4. Clear Data from DE after sending an email.

Now, I am stuck at the point 4. How can I clear Data extension through automation? Please help me I have tried the overwrite activity but it is not working.

2

Use a query activity with overwrite as the update type on the DE with something like:

SELECT 
field1
,field2
,field3
FROM AnyDE
WHERE 1=0

Obviously 1 does not equal 0 so it should overwrite it with zero records.

| improve this answer | |
1

Although @JacksonChen 's answer is a much easier to implement and likely a better solution for most use cases, I also wanted to add in another option for reference (just in case it fits better for someone's use case).

You can accomplish a DE clear via the SOAP API utilizing a Perform Request on the DataExtension Object. See below for example:

<PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI" xmlns:ns2="urn:fault.partner.exacttarget.com">
  <Action>ClearData</Action>
    <Definitions>
      <Definition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="DataExtension">
        <CustomerKey>Test Data Extension</CustomerKey>
      </Definition>
    </Definitions>
</PerformRequestMsg>

This can also be done via WSProxy, like below:

<script runat="server">

custkey = 'myDE'

var prox = new Script.Util.WSProxy();
var action = "ClearData";
var props = {
    DataExtension: {
        CustomerKey: custkey
    }
};
var opts = {};
var data = prox.performItem("DataExtension", props, action, opts);

</script>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.