I am trying to loop through all rows of a data extension and update the name of each record. I created an SSJS script activity to run the below code and it is not erroring out, but it is not updating my data extension either.
I have almost the exact same syntax in another script activity working just fine, but no luck with this one. Also, if I take the code out of the FOR loop and remove the subKey and hard code in a specific value then it will work, but I need that additional functionality to solve for the problem at hand. How do I fix it?
<script runat="server">
Platform.Load('core', '1');
var testDE = DataExtension.Init('Test12345');
var testDEData = testDE.Rows.Retrieve();
for (var i = 0; i < testDEData.length; i++) {
var subKey = testDEData[i].SubscriberKey;
var processing = testDE.Rows.Update({Name:'Bob'}, ['SubscriberKey'], [subKey]);
}
</script>
var subKey;
, then in your for loop do the followingsubKey = testDEData[i].SubscriberKey;
.subKey
is returning a value? It sounds like with the var, there is no match, which is why it is not updating.