plugins/mobile-apps/skills/add-sharepoint/SKILL.md
Use when the user wants to read or write SharePoint lists, manage documents in a SharePoint document library, or create a new SharePoint list from a Power Apps mobile app.
npx skillsauth add microsoft/power-platform-skills add-sharepointInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
📋 Shared instructions: shared-instructions.md — read first.
References:
Two paths: existing lists (skip to Step 6) or new lists (full workflow).
Check for memory-bank.md per shared-instructions.md.
Also confirm this is a mobile app:
test -f power.config.json && test -f app.config.js && echo "OK" || echo "ERROR: not a mobile app"
Ask the user:
If lists already exist: Skip to Step 6.
If creating new lists:
EnterPlanMode, present the list designs with columns and typesExitPlanModeSee api-authentication-reference.md for full details.
az account show # Verify Azure CLI logged in
$api = Initialize-SharePointGraphApi -SiteUrl "https://<tenant>.sharepoint.com/sites/<site-name>"
$headers = $api.Headers
$siteId = $api.SiteId
Requires Sites.Manage.All permission.
Always query existing lists first before creating:
$existingLists = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/sites/$siteId/lists?`$select=id,displayName,description,list&`$filter=list/hidden eq false" -Headers $headers
See list-management-reference.md for Find-SimilarLists, Compare-ListSchemas, and Get-ListSchema functions.
Present findings to user with AskUserQuestion:
Print before starting:
"→ Creating SharePoint lists via Graph API (sequential per list, columns added after list exists)…"
Get explicit confirmation before creating. Use safe functions from list-management-reference.md:
New-SharePointListIfNotExistsAdd-SharePointColumnIfNotExistsAdd-SharePointLookupColumn (for cross-list references)Get the SharePoint Online connection ID (see connector-reference.md):
npx power-apps create-connection --api-id shared_sharepointonline --json
Use shared_sharepointonline as the apiId and capture connectionId from the output. Use these exact values in the commands below.
If create-connection cannot complete because browser-based connection creation is disabled or the connector needs interactive auth, direct the user to create one:
Open
https://make.powerapps.com/environments/<environment-id>/connections→ + New connection → search "SharePoint" → Create. Then provide the connection ID or rerun/list-connections shared_sharepointonline.
Print before starting:
"→ Discovering SharePoint sites accessible to this connection…"
npx power-apps list-datasets --api-id <apiId-from-list> --connection-id <connection-id> --json
Present the sites to the user and ask which one(s) they want to connect to. If the user already specified a site URL, confirm it appears in the list.
If npx power-apps list-datasets fails or returns no results:
Print before starting:
"→ Discovering lists/document libraries on each selected site…"
For each selected site:
npx power-apps list-tables --api-id <apiId-from-list> --connection-id <connection-id> --dataset '<site-url>' --json
Present the tables to the user and ask which ones they want to add. Suggest tables that look relevant to their use case. If lists were created in Step 5, they should appear here.
Print before starting:
"→ Running
npx power-apps add-data-sourceper list (sequential, ~10–20 seconds each)."
SharePoint is a tabular datasource — requires --connection-id, --dataset, and --resource-name:
npx power-apps add-data-source --api-id <apiId-from-list> --connection-id <connectionId-from-list> --dataset '<site-url>' --resource-name '<table-name>'
Run once per list or document library.
Read sharepoint-reference.md before writing any SharePoint code — column encoding, choice fields, and lookups have critical gotchas.
Use Grep to find methods in src/generated/services/SharePointOnlineService.ts (generated files can be very large — see connector-reference.md).
Sample usage:
import { SharePointOnlineService } from '../../src/generated/services/SharePointOnlineService';
// Read items
const result = await SharePointOnlineService.GetItems({
dataset: 'https://contoso.sharepoint.com/sites/projects',
table: 'Project Milestones',
});
const items = result.value ?? [];
// Create item
await SharePointOnlineService.PostItem({
dataset: 'https://contoso.sharepoint.com/sites/projects',
table: 'Project Milestones',
item: { Title: 'Launch review', Status: 'Not Started' },
});
// Update item (SharePoint IDs are integers, not GUIDs)
await SharePointOnlineService.PatchItem({
dataset: 'https://contoso.sharepoint.com/sites/projects',
table: 'Project Milestones',
id: 42,
item: { Status: 'Done' },
});
Print before starting:
"→ Regenerating connector schemas + running tsc to verify SharePoint services compile (~15–30 seconds)."
Native diff:
npx tsc --noEmitinstead ofnpm run build. Do NOT run platform-specific native build commands here.
npx power-apps add-data-source wrote new files into .power/schemas/sharepointonline/. Regenerate connectorSchemas.ts before type-checking so the new list is wired into the runtime schema map:
npm run generate-schemas
npx tsc --noEmit
Fix TypeScript errors before proceeding.
Update memory-bank.md with: connector added, site URL, lists/libraries connected (or created), type-check status.
Note: No manual executor wiring needed.
PowerAppsProviderinapp/_layout.tsxhandles SharePoint connector routing, connection resolution, and OAuth consent automatically at runtime.
development
(Preview) Builds and edits a model-driven Power Apps app from a natural-language intent — tables, columns, relationships, adaptive forms with sub-grids, views, Choice-column charts, generative page intents for overview/dashboard surfaces (page `.tsx` generated in generate-pages after plan approval), and an app module + sitemap — via the headless cds-maker-sdk. Runs an interactive, multi-turn authoring flow (env selection, jobs-to-be-done first, then design-only App Spec authoring across confirmed levels, guardrail lint, plan-mode approval, generate-pages, full build) and a narrated build, and can download a deployed app back into an editable spec to change it. Use when the user says "build an app for X", "create a model-driven app", "make me an app to manage Y", or "edit/add to my app". This skill stands alone and does not require /genpage — but for a standalone generative page added to an app that already exists, use /genpage instead.
data-ai
Use when the user wants to enable offline mode for a Power Apps mobile app and create a Mobile Offline Profile in Dataverse — designs per-table row scope, relationships, columns, and sync frequency through a 3-gate approval flow.
data-ai
Use when the user wants to design or redesign the Dataverse schema and connector plan for an existing mobile app, or has an ER diagram (image, Mermaid, or text) to apply. Skip when the user is creating a brand-new app — /create-mobile-app handles the data model inline.
tools
Use when the user wants to report a bug, file an issue, submit a bug report, or report any problem with the mobile-app plugin.