npx skills add ...
npx skills add microsoft/power-platform-skills --skill add-dataverse
Adds Dataverse tables to a Power Apps code app with generated TypeScript models and services. Can also create new Dataverse tables. Use when connecting to Dataverse, adding tables, creating schema, or querying Dataverse data.
npx skills add microsoft/power-platform-skills --skill add-dataverse
๐ Shared Instructions: shared-instructions.md - Cross-cutting concerns.
References:
Two paths: existing tables (skip to Step 5) or new tables (full workflow).
Check memory bank for project context. Ask the user:
account, contact, cr123_customentity)If tables already exist: Skip to Step 5.
If creating new tables:
contact for people, account for organizations)EnterPlanMode, present ER model with tables, columns, relationships, and creation orderExitPlanModeSee api-authentication-reference.md for full details.
Requires System Administrator or System Customizer security role.
Always query existing tables first before creating:
See table-management-reference.md for Find-SimilarTables, Compare-TableSchemas, and Build-TableNameMapping functions.
Present findings to user with AskUserQuestion:
Get explicit confirmation before creating. Create in dependency order:
Use safe functions from table-management-reference.md:
New-DataverseTableIfNotExistsAdd-DataverseColumnIfNotExistsAdd-DataverseLookupIfNotExists (from data-architecture-reference.md)For each table:
Can add multiple tables by running the command for each one.
The command generates:
src/generated/models/{Table}Model.ts -- TypeScript interfaces, plus {Table}FileColumnName, {Table}ImageColumnName, {Table}UploadColumnName union types if the table has file/image columnssrc/generated/services/{Table}Service.ts -- CRUD methods (create, get, getAll, update, delete) plus upload, downloadFile, downloadImage, deleteFileOrImage if file/image columns existShow the user a usage example:
Key rules:
AccountsService.getAll()), not fetch/axiosresult.data for actual dataFix TypeScript errors before proceeding. Do NOT deploy yet.
Record which tables were added (or created), generated files, and any schema notes.
$existingTables = Invoke-RestMethod -Uri "$baseUrl/EntityDefinitions?`$filter=IsCustomEntity eq true&`$select=SchemaName,LogicalName,DisplayName" -Headers $headerspa app add data-source --connector dataverse --table <table-logical-name>import { AccountsService } from "../generated/services/AccountsService";
const result = await AccountsService.getAll({
select: ["name", "accountnumber"],
filter: "statecode eq 0",
orderBy: ["name asc"],
top: 50
});
const accounts = result.data || [];npm run build