proxy.updateItem
Update an existing SFMC object via the SOAP API. Can be used with SaveOption for upsert behavior.
Syntax
var result = proxy.updateItem(objectType, properties);
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
objectType |
string | Yes | SOAP API object type |
properties |
object | Yes | Properties to update (must include identifier) |
Return Value
{
Status: "OK",
RequestID: "...",
Results: [{ StatusCode: "OK", StatusMessage: "...", Object: {...} }]
}
Examples
Update subscriber status
var proxy = new Script.Util.WSProxy();
var result = proxy.updateItem("Subscriber", {
SubscriberKey: "sub_jane",
Status: "Unsubscribed"
});
Update DE row
var proxy = new Script.Util.WSProxy();
var result = proxy.updateItem(
"DataExtensionObject[MyDE_Key]",
{
Properties: {
Property: [
{ Name: "SubscriberKey", Value: "sub_jane" },
{ Name: "Score", Value: "95" },
{ Name: "UpdatedAt", Value: Platform.Function.Now() }
]
}
}
);