I have tried to use DataExtension.Init() several times with no avail. I can see the Data extension in both parent and child business Unit (it lives in the shared data extension folder). I've also tried a newly created data extension. I keep getting null objects returned even after verifying the DE exists using
var FindDE = DataExtension.Retrieve({Property:DEprop,SimpleOperator:"equals",Value:DEval});
Write("FindDE: " + Stringify(FindDE));
I have tried external Key and name and I can't get it to work. Current code below, any help welcomed!
<script runat="server">
Platform.Load("core","1.1.1");
try {
// Initialize the existing Data Extension
var DEprop = "Name"
var DEval = "Products_Catalog"
var FindDE = DataExtension.Retrieve({Property:DEprop,SimpleOperator:"equals",Value:DEval});
Write("FindDE: " + Stringify(FindDE));
var sourceDE = DataExtension.Init(FindDE[0].CustomerKey);
Write(sourceDE["CustomerKey"]);
Write(sourceDE);
} catch (e) {
// Log error message
Write("Error: " + Stringify(e));
}
</script>