---
schema_version: "1"
id: 63184c99909a2b6ffcdae36c2dbffa3a7dbe86fbb4a32753b40093f4749e0368
title: UpsertDE
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformDataExtensionUpsertDE.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformDataExtensionUpsertDE.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a2a108fa6c5a2092ea922ffc32a73442ede085ee67a5cbb476ae694ea69ef216
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# UpsertDE

Updates or inserts information into a data extension as indicated by the array containing the listed column name and value pairs. This method adds the information if the data extension does not contain an applicable value or updates the existing applicable value to the new value. You can include multiple column name and value parts in a single call. You can use this method in sendable contexts, such as email messages.

## Syntax

`Platform.Function.UpsertDE(1, 2, 3, 4, 5)`

## Function Properties

| Ordinal | Type   | Description                                                |
| ------- | ------ | ---------------------------------------------------------- |
| `1`     | string | Required. Name of data extension                           |
| `2`     | array  | Required. Array containing column names to filter on       |
| `3`     | array  | Required. Array containing values to filter on             |
| `4`     | array  | Required. Array containing column names to include updates |
| `5`     | array  | Required. Array containing column values to update         |

## Examples

```
<script runat="server">
     var rows = Platform.Function.UpsertDE("CustomerData",["ID"],["12345"],["Company","Country","Region"],["exampleCompany","USA","West"]);
</script>
```
