Hi i am unable to create a dynamic data extension from the existing data extension fields. I am using the following code to get that
<script runat="server">
Platform.Load("core","1.2");
var dummyDE = DataExtension.Init("80c489be-20f3-448b-b683-2b098cae20dc");
var fields = dummyDE.Fields.Retrieve();
var DE = "MyDataExtension1", FolderName = "Amit";
var FolderAttributes = Folder.Retrieve({
Property: "Name",
SimpleOperator: "equals",
Value: FolderName
});
var FolderID = FolderAttributes[0].ID;
var obj = {
"CustomerKey" :"XYZ",
"Name": DE,
"CategoryID": FolderID,
"Fields": fields
}
var Status = DataExtension.Add(obj);
</script>