I am trying to figure out how to duplicate an existing Data Extension. That is, for a defined Data Extension, I want to duplicate it, along with the columns and the data in it.

Here's what I think I need to do. For a given Data Extension, we:

  1. Retrieve fields in the Data Extension using DataExtensionField object
  2. Use DataExtensionFieldType object to get the field type (Text, Number, Boolean, etc) of each field returned from step 1
  3. Retieve records from Data Extension in step 1 using DataExtensionObject object
  4. Create new Data Extension using DataExtensionFromAPI setting the columns and field types from steps 1 and 2
  5. Add data from step 3 to new DataExtensionObject

Can someone confirm if this is actually correct? From following the documentation, the issue with this proposed approach is that there does not seem to be a method to retrieve Data Extension field types. According to the documentation, there are no methods supported for the DataExtensionFieldType Object.

I'm at a bit of a loss here how to approach this seemingly straightforward task...


Super close -

Step 1 will retrieve the fields and field types togethers like this:

 <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ns1:fueloauth xmlns:ns1="http://exacttarget.com">xxxxxxxxxxxxxx</ns1:fueloauth>
   <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <Filter xsi:type="SimpleFilterPart">

The rest of your steps look correct.

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.