# Rows

## Row Methods

| Name                            | Description                                                                                                                                                           |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| distinctArray(column)           | Returns an array of distinct values in `column`.                                                                                                                      |
| insert(rows, first?)            | Inserts `rows` into a data table.  If `first` is passed in, the rows are inserted at the top of the `Rows` array.                                                     |
| join(table)                     | Joins a data table with a second table using an inner join.  Visit [DataTables Inner Joins](/wirebootstrap/working-with-datatables/joins.md#inner-join) for examples. |
| leftJoin(table)                 | Joins a data table with a second table using a left join.  Visit [DataTables Left Join](/wirebootstrap/working-with-datatables/joins.md#left-join) for examples.      |
| newRow                          | Returns a new rows with the same schema as the existing rows.  All values are set to `null`.                                                                          |
| replace(keyName, keyValue, row) | Replaces the row with the column value `keyValue` in the column name `keyName` with the `row` passed in.                                                              |

## Delete Row Methods

Use the following methods to `delete` rows from a data table.

| Name              | Description                                                                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eq(column, value) | Deletes the rows where the column `column` is `value`.                                                                                                                  |
| ne(column, value) | Deletes the rows where the column `column` does not equal`value`.                                                                                                       |
| filter(function)  | Deletes rows using a custom function. As the `function` is evaluated, it will receive the current row, index position, and the list of all rows as delegate parameters. |

The following deletes all rows where `UserName` is `apeters`.

```typescript
table.delete().eq("UserName", "apeters");
```

## Update Row Methods

Use the following methods to `update` the values of rows in a data table.

| Name             | Description                                                                                                                                                                                                           |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| update(column)   | Starts an update method chain for a `column` in a data table.                                                                                                                                                         |
| value(value)     | Sets the value of the column passed in the `update` method to `value`.                                                                                                                                                |
| filter(function) | Sets the value of the column passed in the `update` method using a custom function. As the `function` is evaluated, it will receive the current row, index position, and the list of all rows as delegate parameters. |

The first example below sets the `Active` column to `false` for all rows.  The second example sets the `Active` column to `false` only for `UserName` `apeters`.  It is otherwise set to `true`.

```typescript
table.update("Active").value(false);

...

table.update("Active").filter((row, index, rows) => {
    return (row.UserName == "apeters") ? false :  true;
});
```

Visit [DataTable Rows](/wirebootstrap/working-with-datatables/rows.md) for detailed examples of using row data table methods.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wirebootstrap.com/wirebootstrap/reference/wire.data/wire.data.datatable/rows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
