> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryprofound.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Excel in Agents

> Read and write Excel workbooks with Microsoft Excel Agent nodes

After you [connect Microsoft SharePoint](/integrations/microsoft-365/connect-microsoft-sharepoint-to-profound), the following nodes become available in Profound Agents under **Microsoft Suite** > **Microsoft Excel**. Use them to read values and rows from a workbook, write cells and rows back, and create new workbooks or worksheets.

Every node runs with the permissions of the account you select under **Microsoft Account**. A node reaches only the files that the connected account can open.

<Note>
  New to Agents? See [Getting started with Agents](https://help.tryprofound.com/articles/2212787792-create-an-agent) in the Profound Help Center.
</Note>

## Shared settings

Every node that works on an existing workbook takes a **Workbook** and an optional **Worksheet name**. Leave the worksheet empty to use the first visible worksheet. [**Create Workbook**](#create-workbook) creates a new file instead, so it has no **Workbook** field.

### Choosing a workbook

In the node settings, select your **Microsoft Account**, then select a workbook in one of the following ways:

* **Search by name** in the **Workbook** field. Search reaches only the files Microsoft has indexed, so a file created a moment ago may not appear yet.
* **Paste the SharePoint or OneDrive link** of the workbook into the same field.
* **Browse** by selecting **Browse workbooks in OneDrive or SharePoint** at the bottom of the list. This opens the Microsoft file picker, which also finds files search can't show yet.
* **Use a variable** from an earlier node's output, for example the `workbook_ref` that [**Create Workbook**](#create-workbook) returns.

The nodes work with `.xlsx` and `.xlsm` files.

### Value property

Several nodes take a **Value property** under **Advanced settings**. It controls how cell values are handled:

* **Values** — Interpret the value as typed, or as returned by the read nodes, so `10` becomes the number 10 and `=A1+1` becomes a formula.
* **Formulas** — Treat every value in that field as a formula.
* **Text** — Return the cell as it's displayed. Available only in the read nodes, such as [Get Values](#get-values).

A single write can carry up to 100,000 cells, and a cell can hold up to 32,767 characters. Numbers longer than 15 digits are written as text, so Excel doesn't round them.

## Available nodes

<Tabs>
  <Tab title="Get Values" icon="table">
    ### Get Values

    Reads the values in a range of cells.

    #### Required inputs

    * **Microsoft Account** — Select a connected account from the dropdown
    * **Workbook** — Search for a workbook by name, paste its SharePoint or OneDrive link, or browse for it

    #### Optional inputs

    | Input                                            | Default                                          | Description                                                                                                                                                                                                                                                                                        |
    | ------------------------------------------------ | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Worksheet name**                               | First visible worksheet                          | The worksheet to read values from.                                                                                                                                                                                                                                                                 |
    | **Range**                                        | Used range (the range of cells that have values) | A range of cells in A1 notation, such as `A1:D10`. Leave it empty to read all values in the worksheet.                                                                                                                                                                                             |
    | **Value property** (under **Advanced settings**) | **Values**                                       | Which cell property to return. Learn more in [Value property](#value-property)                                                                                                                                                                                                                     |
    | **Output format** (under **Advanced settings**)  | **Rows (2D array)**                              | The shape of the output: **Rows (2D array)**, **Records (list of dicts)**, **Columns (dict of lists)**, **CSV (string)**, **TSV (tab-separated)**, **HTML table**, **Markdown table**, or **Raw (full API response)**. **Records** and **Columns** use the first row of the range as column names. |

    #### Output

    A JSON object with the values in the selected format, the output format, the workbook reference ID, the name of the worksheet, and the range of cells that was read.

    <Tip>
      To write the values back with [**Create Workbook**](#create-workbook), select the same output format in this node as the input format in that node.
    </Tip>
  </Tab>

  <Tab title="Get Row" icon="table-rows">
    ### Get Row

    Reads one row in a worksheet.

    #### Required inputs

    * **Microsoft Account** — Select a connected account from the dropdown
    * **Workbook** — Search for a workbook by name, paste its SharePoint or OneDrive link, or browse for it
    * **Row selection** — **Specific row** (default), **First row**, or **Last row**
    * **Row number** — Required when **Row selection** is set to **Specific row**. Rows are numbered from `1` up to `1,048,576`

    #### Optional inputs

    * **Worksheet name** — The worksheet to read the row from. Defaults to the first visible worksheet
    * **Range** — Limits which columns the row is read from. For example, `A1:D10` returns only columns A to D. Leave it empty to read every column that has data

    #### Output

    A JSON object with the row as an array of values, the row number, and a `record` field that pairs each row value with the column name from the first row.

    When the row read is the first row, the `record` field is empty.
  </Tab>

  <Tab title="Update Cell" icon="pen-to-square">
    ### Update Cell

    Writes a value into a single cell.

    #### Required inputs

    * **Microsoft Account** — Select a connected account from the dropdown
    * **Workbook** — Search for a workbook by name, paste its SharePoint or OneDrive link, or browse for it
    * **Cell** — The cell to write to, such as `B2`
    * **Value** — The value to write: text, a number, a boolean, or a formula such as `=SUM(A1:B1)`. To write a formula, select **Formulas** under **Value property**

    #### Optional inputs

    * **Worksheet name** — The worksheet to write to. Defaults to the first visible worksheet
    * **Value property** (under **Advanced settings**) — **Values** (default) or **Formulas**. Learn more in [Value property](#value-property)

    #### Output

    A JSON object with the workbook reference ID and URL, the name of the worksheet, the range of cells that was updated, and the number of updated cells.
  </Tab>

  <Tab title="Write Rows" icon="list">
    ### Write Rows

    Adds or updates rows in a worksheet.

    #### Required inputs

    | Input                 | Description                                                                                                    | Notes                                                         |
    | --------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
    | **Microsoft Account** | Select a connected account from the dropdown                                                                   | -                                                             |
    | **Workbook**          | Search for a workbook by name, paste its SharePoint or OneDrive link, or browse for it                         | -                                                             |
    | **Mode**              | **Add rows** (default) appends the rows after the last non-empty row. **Update rows** overwrites existing rows | -                                                             |
    | **Row data format**   | **Arrays** (default) or **JSON Objects**                                                                       | Learn more in [How to shape Row data](#how-to-shape-row-data) |
    | **Row data**          | The rows to write                                                                                              | See [How to shape Row data](#how-to-shape-row-data)           |

    #### How to shape **Row data**

    | Row data format  | Mode            | Shape                                                                             | Example                                                                              |
    | ---------------- | --------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
    | **Arrays**       | **Add rows**    | Each inner array is one worksheet row. Its values are written to columns in order | `[["Alice", "alice@example.com", 90], ["Bob", "bob@example.com", 85]]`               |
    |                  | **Update rows** | The first value of each inner array is the number of the row to update            | `[[1, "Alice", "alice@example.com", 95], [3, "Charlie", "charlie@example.com", 88]]` |
    | **JSON Objects** | **Add rows**    | Each object's keys are column letters                                             | `[{"A": "Alice", "B": "alice@example.com", "C": 90}]`                                |
    |                  | **Update rows** | Each object also carries a `row_number` key with the number of the row to update  | `[{"row_number": 1, "A": "Alice", "B": "alice@example.com"}]`                        |

    #### Optional inputs

    * **Worksheet name** — The worksheet to write to. Defaults to the first visible worksheet
    * **Value property** (under **Advanced settings**) — **Values** (default) or **Formulas**. Learn more in [Value property](#value-property)
    * **Start column** (under **Advanced settings**) — The column to start writing at, for example `A` or `E`. Leave empty to start from the first column (`A`)

    #### Output

    A JSON object with the workbook reference ID and URL, the name of the worksheet, the range of cells that was updated, and the number of rows that were created and updated.

    <Note>
      In **Update rows** mode, the rows are written one at a time. If Excel reports a conflict partway through, the rows written before it stay written. Run the node again to rewrite the same cells.
    </Note>
  </Tab>

  <Tab title="Create Workbook" icon="file-plus">
    ### Create Workbook

    Creates a workbook, or adds a worksheet to a workbook that already exists.

    #### Required inputs

    | Input                 | Description                                                                                                                  | Notes                                                                                                             |
    | --------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
    | **Microsoft Account** | Select a connected account from the dropdown                                                                                 | -                                                                                                                 |
    | **Title**             | The name of the new workbook, or of the new worksheet when **Add to Existing Workbook** is set                               | Enter the name without the file extension. The node appends `.xlsx` automatically                                 |
    | **Rows**              | The data to write into the new workbook or a worksheet                                                                       | Select the data format under **Input format**                                                                     |
    | **Input format**      | The format of the data to write: **JSON** (default), **Markdown table**, **CSV**, **TSV (tab-separated)**, or **HTML table** | JSON accepts an array of objects, an array of arrays, or an object that maps each column name to a list of values |

    #### Optional inputs

    | Input                                            | Default       | Description                                                                                                                                                                                                            |
    | ------------------------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Add to Existing Workbook**                     | Empty         | Leave it empty to create a new workbook. Select a workbook to add a worksheet to it instead. **Destination folder** and **Worksheet name** don't apply to an existing workbook, so they disappear when you select one. |
    | **Destination folder**                           | OneDrive root | The folder that receives the new workbook. Search for a folder by name, paste its link, or browse for it.                                                                                                              |
    | **Worksheet name** (under **Advanced settings**) | `Sheet1`      | The name of the first worksheet in the new workbook.                                                                                                                                                                   |
    | **Value property** (under **Advanced settings**) | **Values**    | **Values** or **Formulas**. Learn more in [Value property](#value-property)                                                                                                                                            |

    #### Output

    A JSON object with the workbook reference ID, URL, and title, and the name of the worksheet the data was written to.

    <Tip>
      To store the output of [**Get Values**](#get-values) in a new workbook, select the same format under **Output format** in that node and under **Input format** in this node.
    </Tip>
  </Tab>
</Tabs>

## Troubleshooting

See [Troubleshooting Microsoft 365 setup and Agent errors](/integrations/microsoft-365/microsoft-365-integrations-troubleshooting#excel) for errors the Excel nodes report.
