---
schema_version: "1"
id: 68ef17265f766ad933e5572ef8d4f843242c03addbfbc8c5652f003e3755d9db
title: Update via WSProxy
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_WSProxy_update.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_update.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f560abad1fbafb52f68b01b7736c953a81eb4832e33785e5789f04408c701a36
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Update via WSProxy

To update a single item or several items of the same type in a single call, use the updateItem and updateBatch functions.

- Specify the first two parameters of the update functions like you do for the create functions.
- The optional third parameter includes any properties to be set using the SOAP UpdateOptions object.

## Example 1: Update a Data Extension

This example renames a data extension using its ObjectID.

```
var prox = new Script.Util.WSProxy();
var objectID = "c9875a80-4dad-e411-b071-ac7ba13db5bc";
var name = "Renamed DE";

var res = prox.updateItem("DataExtension", { "ObjectID":objectID, "Name":name });
```

The returned object has the same properties as the Create functions, except the results contain properties from the SOAP UpdateResult items.

## Example 2: Upsert to Data Extension

```
    var api = new Script.Util.WSProxy();

    /* Build DE Object */
    var updateObject = {
        CustomerKey: 'DE_Example',
        Properties: [
             {
                Name: 'FirstName',
                Value: 'Tester'
            },
             {
                Name: 'LastName',
                Value: 'Testerson'
            },
             {
                Name: 'ModifiedDate',
                Value: Platform.Function.Now()
            }
        ]
    };

    var options = {SaveOptions: [{'PropertyName': '*', SaveAction: 'UpdateAdd'}]};

    var res = api.updateItem('DataExtensionObject', updateObject, options);
```

## Related Items

[Create via WSProxy](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_WSProxy_create.md)
