---
title: Update rows
description: Update rows in a database table using workflow data and column mappings.
category: Database
tags: [database, update, sql, records, table]
---

# Update rows

## Description

The **Update Rows** activity modifies existing records in a database table by matching input rows (from previous activities) with existing records using specified key columns. The updates are made by mapping input columns to table columns through a column mapping configuration.

Use this activity when you want to sync changes from processed data back into your database, such as updating employee salaries, product inventory, or transaction statuses.

> **Use case**:  
> After recalculating employee bonuses in a prior transformation, use Update Rows to write those updated amounts back to the HR database table using the Employee ID as the unique key.

---

## Input

| Input Type | Format | Description                                                    |
| ---------- | ------ | -------------------------------------------------------------- |
| **Data**   | Table  | Tabular data where each row represents a record to be updated. |

---

## Output

| Output Type | Format | Description                           |
| ----------- | ------ | ------------------------------------- |
| **Data**    | Table  | Updated rows from the database table. |

---

## Configuration Fields

| Field Name      | Description                                                                                                                                             | Required |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| **Connection**  | Select or configure the database connection. This is used to authenticate and access the table to be updated. Supports SQL-compatible sources.          | Yes      |
| **Table**       | Name of the database table where rows should be updated. Must exist within the connected database.                                                      | Yes      |
| **Key Columns** | One or more columns that uniquely identify rows in the table (e.g., `ID`, `Email`). Used to match input records with existing rows.                     | Yes      |
| **Column Map**  | Maps each input column to the corresponding table column for updating values. Format: `InputColumn → TableColumn`. Can rename or transform field names. | Yes      |

---

## Sample Input

| ID  | Name       | Salary | Department |
| --- | ---------- | ------ | ---------- |
| 101 | John Doe   | 55000  | HR         |
| 102 | Jane Smith | 66000  | HR         |

---

## Sample Configuration

| Field       | Value                                                         |
| ----------- | ------------------------------------------------------------- |
| Connection  | employee-db-connection                                        |
| Table       | Employees                                                     |
| Key Columns | ID                                                            |
| Column Map  | Name → FullName,<br>Salary → Salary,<br>Department → DeptName |

---

## Sample Output

| ID  | FullName   | Salary | DeptName |
| --- | ---------- | ------ | -------- |
| 101 | John Doe   | 55000  | HR       |
| 102 | Jane Smith | 66000  | HR       |

> The matching rows in the database table were updated using the new data provided.
