I'm using following SSJS script to create a Data Extension and set the retention of 7 days at row level:
Platform.Load("core", "1.1");
var deObj = {
"CustomerKey": "my_DE",
"Name": "my DE",
"DataRetentionPeriodLength": 7,
"DataRetentionPeriod": "Days",
"DeleteAtEndOfRetentionPeriod": true,
"RowBasedRetention": false,
"ResetRetentionPeriodOnImport": false,
"Fields": [{
"Name": "id",
"FieldType": "Text",
"MaxLength": 100,
"IsPrimaryKey": true,
"IsRequired": true
},
{
"Name": "person_id",
"FieldType": "Text",
"MaxLength": 80
}
]
};
try {
var myDE = DataExtension.Add(deObj);
} catch (ex) {
Write("An error has occurred: " + Stringify(ex));
}
I could not find any documentation around the Retention attributes but I took the SOAP envelope attributes and tried using it in SSJS. But I keep getting error. Are the DataRetentionPeriodLength
, DataRetentionPeriod
, DeleteAtEndOfRetentionPeriod
, RowBasedRetention
, ResetRetentionPeriodOnImport
not supported with SSJS DataExtension.Add
function?