$npx -y skills add microsoft/power-platform-skills --skill add-office365Adds Office 365 Outlook connector to a Power Apps code app. Use when accessing calendars, sending emails, reading inbox, or managing Outlook events.
| 1 | **📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns. |
| 2 | |
| 3 | # Add Office 365 Outlook |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. Check Memory Bank -> 2. Add Connector -> 3. Review Generated Service -> 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: Add Connector |
| 16 | |
| 17 | **First, find the connection ID** (see [connector-reference.md](${PLUGIN_ROOT}/shared/connector-reference.md)): |
| 18 | |
| 19 | Run the `/list-connections` skill. Find the Office 365 Outlook connection in the output (API name contains `office365`). 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. |
| 20 | |
| 21 | ```bash |
| 22 | npx power-apps add-data-source -a office365 -c <connection-id> |
| 23 | ``` |
| 24 | |
| 25 | ### Step 3: Review Generated Service |
| 26 | |
| 27 | The generated service file (`src/generated/services/Office365OutlookService.ts`) is large. **Use `Grep` to find specific methods** instead of reading the entire file: |
| 28 | |
| 29 | ``` |
| 30 | Grep pattern="async \w+" path="src/generated/services/Office365OutlookService.ts" |
| 31 | ``` |
| 32 | |
| 33 | Key methods (sorted by common usage): |
| 34 | |
| 35 | #### Calendar Operations |
| 36 | |
| 37 | | Method | Purpose | Key Parameters | |
| 38 | | ------------------------- | -------------------------- | -------------------------------------------------------- | |
| 39 | | `GetEventsCalendarViewV2` | Get events in a date range | `calendarId`, `startDateTimeOffset`, `endDateTimeOffset` | |
| 40 | | `V3CalendarPostItem` | Create a calendar event | `table` (calendar ID), `item` (CalendarEventHtmlClient) | |
| 41 | | `CalendarDeleteItem` | Delete an event | `table` (calendar ID), `id` (event ID) | |
| 42 | | `CalendarPatchItem` | Update an event | `table`, `id`, `item` | |
| 43 | | `V2CalendarGetTables` | List available calendars | (none) | |
| 44 | |
| 45 | #### Email Operations |
| 46 | |
| 47 | | Method | Purpose | Key Parameters | |
| 48 | | ----------------- | ------------------ | ---------------------------------------- | |
| 49 | | `SendEmailV2` | Send an email | `emailMessage` (body, to, subject, etc.) | |
| 50 | | `GetEmails` | Get inbox emails | `folderPath`, `fetchOnlyUnread`, `top` | |
| 51 | | `GetEmail` | Get single email | `messageId` | |
| 52 | | `MarkAsRead` | Mark email as read | `messageId` | |
| 53 | | `ReplyToV3` | Reply to an email | `messageId`, `body` | |
| 54 | | `Flag` / `Unflag` | Flag/unflag email | `messageId` | |
| 55 | |
| 56 | #### Contact Operations |
| 57 | |
| 58 | | Method | Purpose | |
| 59 | | ------------------- | -------------------- | |
| 60 | | `GetContactFolders` | List contact folders | |
| 61 | | `ContactGetTables` | List contact tables | |
| 62 | |
| 63 | ### Step 4: Configure |
| 64 | |
| 65 | Ask the user what Office 365 Outlook operations they need (skip if already specified by caller). |
| 66 | |
| 67 | **Calendar -- Get events for a date range:** |
| 68 | |
| 69 | ```typescript |
| 70 | import { Office365OutlookService } from "../generated/services/Office365OutlookService"; |
| 71 | |
| 72 | const result = await Office365OutlookService.GetEventsCalendarViewV2( |
| 73 | "Calendar", // calendarId -- "Calendar" for default |
| 74 | startDate.toISOString(), |
| 75 | endDate.toISOString() |
| 76 | ); |
| 77 | const events = result.data?.value || []; |
| 78 | ``` |
| 79 | |
| 80 | **Calendar -- Create an event:** |
| 81 | |
| 82 | ```typescript |
| 83 | await Office365OutlookService.V3CalendarPostItem("Calendar", { |
| 84 | Subject: "Focus Time", |
| 85 | Start: "2025-06-15T10:00:00", // ISO 8601 format |
| 86 | End: "2025-06-15T11:00:00", |
| 87 | ShowAs: "Busy", |
| 88 | Importance: "Normal", |
| 89 | IsAllDay: false, |
| 90 | Body: "<p>Blocked for focus work</p>", |
| 91 | Reminder: 5 |
| 92 | }); |
| 93 | ``` |
| 94 | |
| 95 | **Calendar -- Delete an event:** |
| 96 | |
| 97 | ```typescript |
| 98 | await Office365OutlookService.CalendarDeleteItem("Calendar", eventId); |
| 99 | ``` |
| 100 | |
| 101 | **Email -- Send an email:** |
| 102 | |
| 103 | ```typescript |
| 104 | await Office365OutlookService.SendEmailV2({ |
| 105 | To: "<recipient-address>", |
| 106 | Subject: "Subject line", |
| 107 | Body: "<p>HTML email body</p>", |
| 108 | Importance: "Normal" |
| 109 | }); |
| 110 | ``` |
| 111 | |
| 112 | **Key types:** |
| 113 | |
| 114 | | Type | Purpose | |
| 115 | | ---------------------------------------------------------- | ------------------------- |