Platform.Function.UpdateDE()

Updates data in a data extension, and returns the number of rows updated.

You can use this function to update data in a data extension in an email. Use the Platform.Function.UpdateData() function to update rows in CloudPages, landing pages, microsites, and SMS messages in MobileConnect.

OrdinalTypeDescription
1StringRequired. The name of the data extension that contains the data to update.
2ArrayRequired. An array that contains the column names to search for a matching value.
3ArrayAn array that contains values to filter on.
4ArrayRequired. An array that contains that names of the columns to update.
5ArrayRequired. An array that contains the new values for the specified columns.

To use the function, first pass it the name of the data extension that contains the data you want to update. Next, pass it an array of the columns to search to find the row that you want to update and optionally an array that includes the values that identify the row to update. Finally, pass it an array that contains the names of the columns that you want to update the data in and an array that contains the updated values for those columns.

In this example, a data extension called "Flights" contains the data in this table.

FlightIdOriginDestPricePerBagSurcharge
1INDNYC100
2INDLAX200
3INDSEA50025
4ORDSEA52510
5ORDLAX400
6SEASAN300
7SEAATL10
8ATLAUS35010
9STLKCA5
10INDATL125

To update the Price value for FlightId 10, use this function.

The function returns 1, indicating that it updated one row. The data extension now contains this data.

FlightIdOriginDestPricePerBagSurcharge
1INDNYC100
2INDLAX200
3INDSEA50025
4ORDSEA52510
5ORDLAX400
6SEASAN300
7SEAATL10
8ATLAUS35010
9STLKCA5
10INDATL316

You can use the Platform.Function.UpdateDE() function to update more than one column in a single row in one operation. To update multiple columns, you must provide one set of search criteria for each column that you want to update.

This example uses a data extension called "Flights2" that contains the data in this table.

FlightIdOriginDestPricePerBagSurcharge
1INDNYC100
2INDLAX200
3INDSEA50025

Use this code to update the Dest, Price, and PerBagSurcharge fields for FlightId 1.

The function returns 1, indicating that it updated one row. The data extension now contains this data.

FlightIdOriginDestPricePerBagSurcharge
1INDJFK7510
2INDLAX200
3INDSEA50025