I am trying to create a Data Extension using SSJS Script through Automation Studio.
My script is as follows:
<script runat="server">
platform.load("core","1.1");
var deObj = {
"CustomerKey" : "demoDE",
"Name" : "My Demo DE",
"Fields" : [
{ "Name" : "Field 1", "FieldType" : "Number", "IsPrimaryKey" : true, "IsRequired" : true },
{ "Name" : "Field 2", "FieldType" : "Text", "MaxLength" : 50 },
{ "Name" : "Field 3", "FieldType" : "Date", "Ordinal" : 2 },
]
};
var myDE = DataExtension.Add(deObj);
</script>
But it keeps giving me an error when I run the automation, even if I only have the platform.load("Core","1.1")
line in my script it still shows error :( ..
is that possible to create DE using script through Automation Studio?
If so why platform.load("Core","1.1") is not working for me? Do I need to do anything extra to enable these functions?
Or is there any other way to run this script on a landing page, if so can someone advice me how to do this?
Many Thanks