$npx -y skills add microsoft/power-platform-skills --skill add-excelAdds Excel Online (Business) connector to a Power Apps code app. Use when reading or writing Excel workbook data from OneDrive or SharePoint.
| 1 | **📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns. |
| 2 | |
| 3 | # Add Excel Online |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. Check Memory Bank → 2. Gather → 3. Add Connector → 4. Configure → 5. Build → 6. Update Memory Bank |
| 8 | |
| 9 | --- |
| 10 | |
| 11 | ### Step 1: Check Memory Bank |
| 12 | |
| 13 | Check for `memory-bank.md` per [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md). |
| 14 | |
| 15 | ### Step 2: Gather |
| 16 | |
| 17 | Ask the user: |
| 18 | |
| 19 | 1. Where is the workbook? (OneDrive or SharePoint) |
| 20 | 2. Workbook file name |
| 21 | 3. Which table(s) in the workbook to access |
| 22 | |
| 23 | ### Step 3: Add Connector |
| 24 | |
| 25 | **First, find the connection ID** (see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md)): |
| 26 | |
| 27 | Run the `/list-connections` 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 `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create. |
| 28 | |
| 29 | Excel Online is a tabular datasource -- requires `-c` (connection ID), `-d` (drive), and `-t` (table name in workbook): |
| 30 | |
| 31 | ```bash |
| 32 | # OneDrive workbook |
| 33 | npx power-apps add-data-source -a excelonlinebusiness -c <connection-id> -d 'me' -t 'Table1' |
| 34 | |
| 35 | # SharePoint workbook -- dataset is the document library path |
| 36 | npx power-apps add-data-source -a excelonlinebusiness -c <connection-id> -d 'sites/your-site' -t 'Table1' |
| 37 | ``` |
| 38 | |
| 39 | Run for each table the user needs. |
| 40 | |
| 41 | ### Step 4: Configure |
| 42 | |
| 43 | **AddRowIntoTable** -- adds a row to an Excel table: |
| 44 | |
| 45 | ```typescript |
| 46 | // OneDrive workbook |
| 47 | await ExcelOnlineBusinessService.AddRowIntoTable({ |
| 48 | source: "me", |
| 49 | drive: "me", |
| 50 | file: "MyWorkbook.xlsx", |
| 51 | table: "Table1", |
| 52 | body: { column1: "value1", column2: "value2" } // Flat object, NO "items" wrapper |
| 53 | }); |
| 54 | |
| 55 | // SharePoint workbook |
| 56 | await ExcelOnlineBusinessService.AddRowIntoTable({ |
| 57 | source: "sites/your-site", |
| 58 | drive: "drive-id", |
| 59 | file: "SharedWorkbook.xlsx", |
| 60 | table: "Table1", |
| 61 | body: { column1: "value1", column2: "value2" } |
| 62 | }); |
| 63 | ``` |
| 64 | |
| 65 | **Key points:** |
| 66 | |
| 67 | - `source: "me"` and `drive: "me"` for OneDrive personal files |
| 68 | - For SharePoint, use the site path and drive ID |
| 69 | - The `body` is a flat key-value object matching column headers -- do NOT wrap in `{ items: ... }` |
| 70 | |
| 71 | Use `Grep` to find specific methods in `src/generated/services/ExcelOnlineBusinessService.ts` (generated files can be very large -- see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md#inspecting-large-generated-files)). |
| 72 | |
| 73 | ### Step 5: Build |
| 74 | |
| 75 | ```bash |
| 76 | npm run build |
| 77 | ``` |
| 78 | |
| 79 | Fix TypeScript errors before proceeding. Do NOT deploy yet. |
| 80 | |
| 81 | ### Step 6: Update Memory Bank |
| 82 | |
| 83 | Update `memory-bank.md` with: connector added, workbook/table configured, build status. |