# SpreadsheetAddRows

Adds multiple rows from a query to an Excel spreadsheet object.

## Method Signature

```
SpreadsheetAddRows(spreadsheetObj=[any], data=[any], row=[any], column=[any], insert=[any], datatype=[any], includeColumnNames=[any])
```

### Arguments

| Argument         | Type  | Required | Description                                          | Default |
| ---------------- | ----- | -------- | ---------------------------------------------------- | ------- |
| `spreadsheetObj` | `ANY` | `true`   | The spreadsheet object.                              |         |
| `data`           | `ANY` | `true`   | An array of arrays or a query object to add as rows. |         |

## Examples

Add multiple rows from array of arrays:

```js
// Add multiple rows at once
var spreadsheet = SpreadsheetNew();
var data = [
    [ "John", "Sales", 75000 ],
    [ "Alice", "Marketing", 65000 ],
    [ "Bob", "IT", 80000 ]
];
SpreadsheetAddRows( spreadsheet, data );
```

Add a query as spreadsheet rows:

```js
// Convert query results to spreadsheet rows
var spreadsheet = SpreadsheetNew();
var employees = queryExecute( "SELECT name, department, salary FROM employees" );
SpreadsheetAddRows( spreadsheet, employees );
```

Batch import data:

```js
// Import from external data source
var spreadsheet = SpreadsheetNew();

// Add headers
SpreadsheetAddRow( spreadsheet, [ "ID", "Product", "Price", "Stock" ] );

// Add bulk data
var products = [
    [ 1, "Widget", 19.99, 100 ],
    [ 2, "Gadget", 29.99, 50 ],
    [ 3, "Gizmo", 39.99, 75 ]
];
SpreadsheetAddRows( spreadsheet, products );
```

## Related

* [SpreadsheetAddRow()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetaddrow.md) - Add a single row
* [SpreadsheetDeleteRows()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetdeleterows.md) - Delete multiple rows
* [SpreadsheetRead()](/boxlang-+-++/modules/bx-spreadsheet/built-in-functions/spreadsheetread.md) - Read spreadsheet data
* [Query Operations Guide](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/query-operations.md) - Working with queries
* [Batch Operations](https://github.com/ortus-boxlang/boxlang-docs/blob/v1.x/boxlang-framework/boxlang-plus/modules/bx-spreadsheet/batch-operations.md) - Bulk data operations

\| `row` | `NUMERIC` | `false` | The row number where to start inserting 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 new rows or overwrite existing rows. Default is false. | true | | `datatype` | `BOOLEAN` | `false` | The data type to apply to the cells (not implemented in this version). | false | | `includeColumnNames` | `any` | `false` | Whether to include column names as the first row. Default is false. | |

## Examples

## Related


---

# 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/spreadsheetaddrows.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.
