add-excel
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
📋 通用说明: shared-instructions.md - 跨领域相关事项。
Add Excel Online
添加Excel Online
Workflow
工作流程
- Check Memory Bank → 2. Gather → 3. Add Connector → 4. Configure → 5. Build → 6. Update Memory Bank
- 检查记忆库 → 2. 收集信息 → 3. 添加连接器 → 4. 配置 → 5. 构建 → 6. 更新记忆库
Step 1: Check Memory Bank
步骤1: 检查记忆库
Check for per shared-instructions.md.
memory-bank.md按照shared-instructions.md的要求检查。
memory-bank.mdStep 2: Gather
步骤2: 收集信息
Ask the user:
- Where is the workbook? (OneDrive or SharePoint)
- Workbook file name
- Which table(s) in the workbook to access
询问用户以下问题:
- 工作簿位置?(OneDrive 或 SharePoint)
- 工作簿文件名
- 要访问的工作簿中的哪些表格
Step 3: Add Connector
步骤3: 添加连接器
First, find the connection ID (see connector-reference.md):
Run the skill. Find the Excel Online (Business) connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from or a prior step): → + New connection → search for the connector → Create.
/list-connectionspower.config.jsonhttps://make.powerapps.com/environments/<environment-id>/connectionsExcel Online is a tabular datasource -- requires (connection ID), (drive), and (table name in workbook):
-c-d-tbash
undefined首先,查找连接ID(请参阅connector-reference.md):
运行技能。在输出结果中找到Excel Online (Business)连接。如果不存在,请引导用户使用特定环境的连接URL创建连接——根据上下文(来自或之前步骤)中的活动环境ID构造URL: → + 新建连接 → 搜索该连接器 → 创建。
/list-connectionspower.config.jsonhttps://make.powerapps.com/environments/<environment-id>/connectionsExcel Online是表格数据源——需要(连接ID)、(驱动器)和(工作簿中的表格名称):
-c-d-tbash
undefinedOneDrive workbook
OneDrive工作簿
pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'me' -t 'Table1'"
pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'me' -t 'Table1'"
SharePoint workbook -- dataset is the document library path
SharePoint工作簿 -- 数据集为文档库路径
pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'sites/your-site' -t 'Table1'"
Run for each table the user needs.pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'sites/your-site' -t 'Table1'"
为用户需要的每个表格运行上述命令。Step 4: Configure
步骤4: 配置
AddRowIntoTable -- adds a row to an Excel table:
typescript
// OneDrive workbook
await ExcelOnlineBusinessService.AddRowIntoTable({
source: "me",
drive: "me",
file: "MyWorkbook.xlsx",
table: "Table1",
body: { column1: "value1", column2: "value2" } // Flat object, NO "items" wrapper
});
// SharePoint workbook
await ExcelOnlineBusinessService.AddRowIntoTable({
source: "sites/your-site",
drive: "drive-id",
file: "SharedWorkbook.xlsx",
table: "Table1",
body: { column1: "value1", column2: "value2" }
});Key points:
- and
source: "me"for OneDrive personal filesdrive: "me" - For SharePoint, use the site path and drive ID
- The is a flat key-value object matching column headers -- do NOT wrap in
body{ items: ... }
Use to find specific methods in (generated files can be very large -- see connector-reference.md).
Grepsrc/generated/services/ExcelOnlineBusinessService.tsAddRowIntoTable -- 向Excel表格添加一行:
typescript
// OneDrive工作簿
await ExcelOnlineBusinessService.AddRowIntoTable({
source: "me",
drive: "me",
file: "MyWorkbook.xlsx",
table: "Table1",
body: { column1: "value1", column2: "value2" } // 扁平对象,请勿使用"items"包裹
});
// SharePoint工作簿
await ExcelOnlineBusinessService.AddRowIntoTable({
source: "sites/your-site",
drive: "drive-id",
file: "SharedWorkbook.xlsx",
table: "Table1",
body: { column1: "value1", column2: "value2" }
});关键要点:
- 和
source: "me"适用于OneDrive个人文件drive: "me" - 对于SharePoint,请使用站点路径和驱动器ID
- 是与列标题匹配的扁平键值对象——请勿用
body包裹{ items: ... }
使用在中查找特定方法(生成的文件可能非常大——请参阅connector-reference.md)。
Grepsrc/generated/services/ExcelOnlineBusinessService.tsStep 5: Build
步骤5: 构建
powershell
npm run buildFix TypeScript errors before proceeding. Do NOT deploy yet.
powershell
npm run build在继续之前修复所有TypeScript错误。暂不部署。
Step 6: Update Memory Bank
步骤6: 更新记忆库
Update with: connector added, workbook/table configured, build status.
memory-bank.md在中更新以下内容:已添加连接器、已配置工作簿/表格、构建状态。
memory-bank.md