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:
- Retrieve fields in the Data Extension using
DataExtensionField
object - Use
DataExtensionFieldType
object to get the field type (Text, Number, Boolean, etc) of each field returned from step 1 - Retieve records from Data Extension in step 1 using
DataExtensionObject
object - Create new Data Extension using
DataExtensionFromAPI
setting the columns and field types from steps 1 and 2 - 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...