# Database Update Row

> Update an existing row in a database with new values.

- ID: `db_update_row`
- Type: Block
- Category: [Databases](https://inventor.bot/docs/reference/blocks/databases.md)

- Database columns are extra inputs/outputs named `dbcol_<column name>`.

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `database_id` | yes | Select the database containing the row. |  |
| `row_id` | yes | The unique ID of the row to update. | e.g. `"abc123xyz"` |
| `update_mode` |  | How to handle empty fields: keep existing values or replace with empty. | `"Keep existing values"`, `"Replace all values"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `row_id` | The unique ID of the updated row. | e.g. `"abc123xyz"` |
| `updated` | Whether the row was successfully updated (true/false). | e.g. `"true"` |
| `row_json` | The updated row as a JSON object, including system fields (__id, __created_at, __updated_at, __created_at_unix, __updated_at_unix). | e.g. `"{\"__id\":\"abc123\",\"name\":\"example\"}"` |

**Example**

```go
row := db_update_row(Args{database_id: "...", row_id: "abc123xyz"})
send_text_message(Args{channel_id: trigger.channel_id, message_content: "Row ID: " + row.row_id})
```