# SpreadsheetAddRow

Adds a row to an Excel spreadsheet object.

## Method Signature

```
SpreadsheetAddRow(spreadsheetObj=[any], data=[any], row=[any], column=[any], insert=[any])
```

### Arguments

| Argument         | Type      | Required | Description                                                                                     | Default |
| ---------------- | --------- | -------- | ----------------------------------------------------------------------------------------------- | ------- |
| `spreadsheetObj` | `ANY`     | `true`   | The spreadsheet object.                                                                         |         |
| `data`           | `ANY`     | `true`   | An array of data to add to the row, or a comma delimited string of cell entries, one per column |         |
| `row`            | `NUMERIC` | `false`  | The row number where to insert the data (1-based). If not specified, adds to the end.           |         |
| `column`         | `NUMERIC` | `false`  | The column number where to start inserting the data (1-based). Default is 1.                    |         |
| `insert`         | `BOOLEAN` | `false`  | Whether to insert a new row or overwrite existing row. Default is false.                        | true    |

## Examples

Add a row with array data:

```js
// Add a row of data as an array
var spreadsheet = SpreadsheetNew();
var rowData = [ "John", "Sales", 75000 ];
SpreadsheetAddRow( spreadsheet, rowData );
println( "Row added to spreadsheet" );
```

Add a row to the end:

```js
// Append rows to existing spreadsheet
var spreadsheet = SpreadsheetRead( "/path/to/file.xlsx" );
SpreadsheetAddRow( spreadsheet, [ "Alice", "Marketing", 65000 ] );
SpreadsheetAddRow( spreadsheet, [ "Bob", "IT", 80000 ] );
```

Insert a row at a specific position:

```js
// Insert a row without overwriting
var spreadsheet = SpreadsheetNew();
SpreadsheetAddRow( spreadsheet, [ "Header1", "Header2", "Header3" ] );
SpreadsheetAddRow( spreadsheet, [ "Data1", "Data2", "Data3" ] );

// Insert a new row at position 2 (shifts existing rows down)
SpreadsheetAddRow( spreadsheet, [ "New", "Row", "Data" ], row = 2, insert = true );
```

Add comma-delimited data:

```js
// Add row using comma-delimited string
var spreadsheet = SpreadsheetNew();
SpreadsheetAddRow( spreadsheet, "John,Doe,john@example.com" );
SpreadsheetAddRow( spreadsheet, "Jane,Smith,jane@example.com" );
```

## Related

* [SpreadsheetAddRows()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetaddrows.md) - Add multiple rows at once
* [SpreadsheetDeleteRow()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetdeleterow.md) - Delete a row
* [SpreadsheetSetCellValue()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetsetcellvalue.md) - Set individual cell values
* [SpreadsheetFormatRow()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetformatrow.md) - Format a row
* [Row Operations Guide](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/row-operations.md) - Working with rows


---

# 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://boxlang.ortusbooks.com/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetaddrow.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.
