---
schema_version: "1"
id: 8f9c7e8b3feae6dede712f5e97c91a4b6b7718d61fa98cbf129844095957c92c
title: Rows.Update
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_dataExtensionRowsUpdate.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_dataExtensionRowsUpdate.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2b25ef04f2fa1d6aaf585a3f7a52337ed10beed353df2bed39f800de9dd5fbc7
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Rows.Update

Updates field values in a specified data extension row.

## Syntax

`Rows.Update(1, 2, 3)`

## Function Properties

| Ordinal | Type   | Description                                                                                                                                                                                   |
| ------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `1`     | Object | Required. An object that contains the data to insert. For each item in the object, the key is the name of the column to update, and the value is the value to update in the specified column. |
| `2`     | Array  | Required. An array of strings that lists the columns to search for a matching value.                                                                                                          |
| `3`     | Array  | Required. An array that lists the values to find in the columns listed in the second ordinal. You must specify one value for each column listed in the second ordinal.                        |

## Example

This code example instantiates a data extension named "NTO Customer List". It then uses the `Update()` function to locate a row in the data extension where the value of the `MemberId` field is 9868600 and the value of the `Country` field is "CA". If it locates a matching row, the function updates the `StateProvince` field to contain the value "QC" and updates the `PreferredActivity` field to contain the value "Sailing". If the function doesn’t find a row that matches both of the specified criteria, it returns an error.

```js
<script runat="server">
  Platform.Load("Core", "1");

  try {
    var dataExt = DataExtension.Init("NTO Customer List");

    var fieldsToUpdate = {
      StateProvince : "QC",
      PreferredActivity : "Sailing"
    };

    var result = dataExt.Rows.Update(
      fieldsToUpdate,
      ["MemberId", "Country"],
      [9868600, "CA"]
    );

    Write(Stringify(result));

  } catch(error) {
        Write(Stringify(error));
  }
</script>
```
