I was able to update 1 record at a time using this code:
var prox = new Script.Util.WSProxy();
var props = [
{
"Name": "Contact_Key",
"Value": "QA_2"
},
{
"Name": "Random_Field",
"Value": "4444"
}
];
var options = {
SaveOptions: [
{
PropertyName: 'Random_Field',
SaveAction: 'UpdateAdd'
}
]
};
try {
var result = prox.updateItem("DataExtensionObject", {
CustomerKey: "XXXXXX",
Properties: props
}, options);
Write(Stringify(result));
} catch (error) {
Write(Stringify("error: " + error));
}
Reference: Update via WSProxy
In the same doc, it's mentioned there is an option to use updateBatch
instead of updateItem
. But I was not able to make it work.
Any Idea how to make it work? Or any other suggestion on how to update mass quantity of rows (over 2500) in a DE?
My target is to update all rows with a condition to a value (like true/false)