> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/append-excel-file.md).

# Append excel file

Appending an excel file is a smart action used to automatically find the first empty row at the end of the data table and append content to it, allowing you not to manually calculate or manage the row index.

#### Configuration parameters:

* File Path: The absolute path to the Excel file where data needs to be appended (e.g., `D:\GPM\data.xlsx`).
* Sheet index: The position of the sheet where data needs to be written, starting from 0 *(The first sheet is `0`)*.
* Column Name or Index: The position of the column where data needs to be written. You can specify it in two ways:
  * By letter: `A`, `B`, `C`, `D`...
  * By index number, starting from 1 *(Column A is `1`, Column B is `2`...)*.
* Value: The text content (or variable containing data) that you want to write into the last empty cell of that column.

#### Practical example: Append content to column B starting from row 6

Suppose you have an Excel file containing a current data list with text from row 1 to row 5. You want to configure a script to automatically append a new piece of data (for example, a coupon code just scratched) into the next empty cell of column B (which is cell `B6`).

Instead of having to use a read file action to count which row is empty and then use the *Write excel file* command, you just need to configure the Append excel file action as follows:

* Configuration:
  * File Path: `D:\GPM\data.xlsx`
  * Sheet index: `0`
  * Column Name or Index: `B` *(Select column B to append data)*.
  * Value: Enter the string content (or pass the variable containing data, e.g., coupon code variable `$couponCode`).

Result: The system will automatically scan column B from top to bottom, recognizing that rows 1 to 5 already have data, and immediately write the value of the variable into the first empty row (row 6 - cell `B6`). In the next run of the script, new data will again be automatically pushed down to row 7 (`B7`), row 8 (`B8`)... sequentially and accurately.

<figure><img src="/files/PqUKPoERqA0NiUeTmyFd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qHOe0zhcVX6jHySJscnS" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/append-excel-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
