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

# SharePoint

> SharePoint 是一款内容与协作应用，可通过你已连接的帐户管理站点、文件、列表和页面。

# SharePoint

当你的工作流需要 SharePoint 内容、文件、列表或站点页面时，请使用此应用。选择读取操作以查找站点、驱动器、列表和项目，选择写入操作以创建或更新记录和文件。

## 配置

| 选项 | 是否必需 | 说明 |
| - | - | - |
| 名称 | 否 | 工作流画布中该步骤的标签。 |
| Authentication | 是 | 此步骤要使用的已连接 SharePoint 帐户。 |
| Action | 是 | 要执行的 SharePoint 操作（例如 Get current user、List sites、Get site、Get site by hostname）。 |
| Arguments | 是 | 根据操作的 schema 生成的逐操作表单字段。每个文本字段都有一个 **Insert Variable** 按钮，可注入 `{{placeholder}}` 值。还有一个 **Raw JSON** 选项卡可用于高级用法。 |
| When the step fails | 否 | 控制此步骤失败时工作流应 **Terminate Workflow** 还是 **Continue**。 |

在配置此步骤之前，请通过登录流程在你工作区的 **Integrations** 中连接 SharePoint。如果没有可用的活动连接，该步骤会显示一个警告，并提供指向 **Integrations** 的链接，而不是帐户选择器。

## Arguments form

当你选择一个操作时，**Arguments** 部分会根据该操作的输入 schema 显示一个表单。引用现有记录的字段包含下拉选择器。

如果你更愿意手动编写完整的参数对象，请切换到 **Raw JSON** 选项卡。任一选项卡中的更改都会保持同步。

## 常用操作

| Action | Description |
| - | - |
| **Get current user** | 检索已连接的 SharePoint 用户资料。 |
| **List sites** | 列出已连接帐户可访问的 SharePoint 站点。 |
| **Get site** | 通过 ID 检索 SharePoint 站点的详细信息。 |
| **Get site by hostname** | 通过主机名或 URL 检索 SharePoint 站点。 |
| **List site drives** | 列出 SharePoint 站点的文档库。 |
| **Get drive** | 通过 ID 检索 SharePoint 驱动器的元数据。 |
| **List drive children** | 列出 SharePoint 驱动器中的文件和文件夹。 |
| **Get drive item** | 通过项目 ID 检索驱动器中的文件或文件夹。 |
| **Upload file** | 将文件上传到 SharePoint 文件夹。 |
| **Update drive item** | 更新 SharePoint 文件或文件夹的属性。 |
| **List lists** | 列出当前站点中的所有 SharePoint 列表。 |
| **Get list** | 通过标题检索 SharePoint 列表。 |
| **Get list items** | 按标题检索 SharePoint 列表中的项目。 |
| **Get list item** | 通过 ID 检索一个 SharePoint 列表项。 |
| **Create list item** | 通过 GUID 在 SharePoint 列表中创建新项目。 |

删除记录等破坏性操作在工作流操作选择器中不可用。

## 输出

此步骤会将 SharePoint 响应存储为步骤输出。响应的形状取决于操作。

在后续步骤中使用完整的输出引用：

```text theme={null}
{{STEP_IDENTIFIER.output}}
```

## 示例

1. 打开 **Integrations**，如果你还没有连接 SharePoint，就先连接它。
2. 在你的工作流中添加一个 **SharePoint** 步骤。
3. 在 **Authentication** 中选择一个已连接帐户。
4. 在 **Action** 中选择 **Get current user**。
5. 填写必填字段。使用 **Insert Variable** 引用前一步的输出作为任何字段值。
6. 点击步骤标题栏中的 **Run** 来测试该操作，然后在 **Output** 中查看返回的有效负载。

## 用例

### 从表单创建列表项

1. Get list
2. Create list item
3. Get list item

### 上传并标记文件

1. List site drives
2. Upload file
3. Update drive item

### 查看站点页面

1. List site pages
2. Get page content
3. Get site

## 备注

* 此步骤依赖于你工作区中已连接的 SharePoint 集成。
* 工作流操作选择器会显示一组精选操作。拥有 SharePoint 工具的代理可以使用更多操作。
* 登录界面可能会显示第三方授权品牌标识。

## 将 SharePoint 作为代理工具使用

你也可以在 **Agent Editor** 中将 SharePoint 添加为工具。打开代理，点击 **Add tool**，然后选择 **SharePoint**。在工具设置面板中，选择代理应使用的已连接帐户。代理会在与对话相关时调用 SharePoint 操作。

另请参见：[Integrations](https://docs.fetchhive.com/zh/workspace/integrations.md)、[Creating and Editing](https://docs.fetchhive.com/zh/workflows/creating-and-editing.md) 和 [Testing and Iteration](https://docs.fetchhive.com/zh/workflows/testing-and-iteration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.