I am trying to use SSJS to retrieve the DE names of all DE's in a particular folder (folderid = 14273, not sure if that needs to be in quotations), and save them in an upsert DE (DE name = DEDEDede). The below script runs successfully in automation studio but when I check back DEDEDede, no rows are generated. I also tried testing by hardcoding the name of just 1 DE in the folder but that didn't work either.
The upsert DE has 2 fields, Name (primary key, text, max 300 characters) and CreatedDate (date, nullable)
<script runat="server">
Platform.Load("core""Core", "1""1.1.1");
var apifolderId = new"14273"; Script.Util.WSProxy();
var folderIDtargetDEName = "14273";"Dede";
var targetDEdataExtensions = Platform.Function.DataExtension.InitRetrieve("DEDE"{Property:"CategoryID", SimpleOperator:"equals", Value:folderId});
try {
for (var reqi = api0; i < dataExtensions.retrieve("DataExtension",length; ["Name"],i++) {
var Property:deName "CategoryID",
= dataExtensions[i].Name;
SimpleOperator: "equals",
var Value:rowsAffected folderID= Platform.Function.UpsertData(
});
if (req.Results.length > 0)targetDEName, {
for (var i = 0; i < req.Results.length; i++) {
['Name'], var deName = req.Results[i].Name;
var data = [
[deName], {
Name: deName
['CreatedDate'], }
[null] ];
targetDE.Rows.Upsert(["Name"], data);
}
}
} catch (error) {);
}
</script>