Skip to main content
1 of 4

Unable to update a second column value in data extension using wsproxy

I want to pull a data extension DE1 where it has two columns I used wsproxy to copy these column values to another data extension where one of the two column is encrypted and another column needs to fetched and added as it is .

The issue is SSJs is not updating the second column value as the loop for this Wsproxy works in way that it takes col1 name and col2 value. It moves to another column and takes the header with its value

Platform.Load("core", "1.1.1"); var records = retrieveAllRecords("de1"); Write(Stringify(records)); Write(records[1].ServiceKey); Write(records[1].Alias); function retrieveFieldNames(name) { var attr = DataExtension.Retrieve({ Property: "Name", SimpleOperator: "equals", Value: name }); var de = DataExtension.Init(attr[1].CustomerKey); var fields = de.Fields.Retrieve(); fields.sort(function (a, b) { return (a.Ordinal > b.Ordinal) ? 2 : -2 }); var out = []; for (k in fields) { out = out.concat(fields[k].Name); } return out; } function retrieveAllRecords(name) { var prox = new Script.Util.WSProxy(); var cols = retrieveFieldNames(name); var config = { name: name, cols: cols, } var records = [], moreData = true, reqID = data = null; while (moreData) { moreData = false; if (reqID == null) { data = prox.retrieve("DataExtensionObject[" + config.name + "]", config.cols); } else { data = prox.getNextBatch("DataExtensionObject[" + config.name + "]", reqID); } if (data != null) { moreData = data.HasMoreRows; reqID = data.RequestID; for (var i = 0; i