# 读取 Excel

节点类型 `browser_useExcel`

## 功能说明

从本机 Excel 工作簿读取数据。

## 客户端配置界面

![读取 Excel节点的客户端配置界面](/assets/use-excel.8897d407e85c0f101214713117557743cfa0c66be4ab7bcb8a5ed549cb0af158.0538f3a9.webp)

截图来自 MoreLogin 桌面客户端 V2.73.101 的英文界面。

## 输入字段

以下字段位于 `data.browserUi.inputs`。

| 字段 | 类型或取值 | Schema 必填 | 执行默认值 | 说明与边界 |
|  --- | --- | --- | --- | --- |
| `path` | `string` | 否 | — | Excel 文件 |
| `sheetName` | `string` | 否 | — | 工作表 |
| `filterEnabled` | `boolean`（支持变量引用） | 否 | `false` | 筛选行 编辑器初值 `false` |
| `conditions` | array<`object`> | 否 | — | 筛选条件 |
| `conditionLogic` | `"and"` / `"or"`（支持变量引用） | 否 | `"and"` | 条件关系 编辑器初值 `"and"` |


## 条件与边界

- sheetName（必填）选择工作表，filterEnabled/conditions/conditionLogic 筛选整行，返回 sourceRowCount；path 为本机绝对路径，运行时读取实际文件。
- 校验错误码 `RPA_NODE_INPUT_INVALID`


## 输入引用

| 字段 | 允许的形式 |
|  --- | --- |
| `path` | `literal`, `template` |
| `sheetName` | `literal`, `template` |
| `filterEnabled` | `literal`, `template` |
| `conditions` | `literal` |
| `conditionLogic` | `literal`, `template` |


## 输出字段

| 输出字段 | 类型或取值 |
|  --- | --- |
| `rows` | array<`object`> |
| `rowCount` | `number` |
| `sourceRowCount` | `number` |
| `columns` | array<`string`> |
| `sheetName` | `string` |
| `materials` | `["null","boolean","number","string"]` / array<`JSON`> / `object` |
| `skipped` | `boolean` |


按契约用 `${nodeId.data.field}` 引用公开字段。

## JSON 示例

可放入流程 `nodes` 数组或其他节点 `blocks` 中的完整节点对象。把本机路径换成你电脑上的绝对路径。

```json
{
  "id": "read_accounts",
  "type": "browser_useExcel",
  "data": {
    "title": "读取账号表格",
    "browserAction": "useExcel",
    "browserUi": {
      "inputs": {
        "path": "/Users/example/Documents/accounts.xlsx",
        "sheetName": "Sheet1",
        "filterEnabled": false
      },
      "exception": {
        "timeout": 30000,
        "policy": "interrupt"
      }
    }
  }
}
```

[返回节点目录](/zh/browser-rpa/nodes)