为 Power Apps 代码应用添加 Dataverse 表,并生成 TypeScript 模型与服务。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "add-dataverse" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/code-apps/skills/add-dataverse/SKILL.md 2. 保存为 ~/.claude/skills/add-dataverse/SKILL.md 3. 装好后重载技能,告诉我可以用了
请把 Dataverse 中的 Accounts、Contacts 和 Opportunities 表添加到我的 Power Apps 代码应用中,并生成对应的 TypeScript 模型与数据服务。
已接入所选表,并生成可直接用于查询和调用的 TypeScript 模型与服务代码。
在 Dataverse 中创建一个“项目申请”表,包含申请人、部门、预算、状态和提交时间字段,并将该表加入 Power Apps 代码应用,生成 TypeScript 模型和服务。
新表及字段已创建,并完成应用接入,附带对应的 TypeScript 数据模型与访问服务。
将 Dataverse 的 Cases 表添加到应用中,生成 TypeScript 服务,并示例展示如何按状态筛选记录和读取详细字段。
生成 Cases 表的接入代码,并提供基于服务层的查询示例,便于后续开发数据读取逻辑。
📋 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.
az account show # Verify Azure CLI logged in
# Find your Dataverse environment URL:
# In make.powerapps.com → Settings → Developer resources → Web API endpoint
# It looks like: https://<org-name>.crm.dynamics.com/api/data/v9.2/
# Use the base URL: https://<org-name>.crm.dynamics.com
$api = Initialize-DataverseApi -EnvironmentUrl "https://<org>.crm.dynamics.com"
$headers = $api.Headers
$baseUrl = $api.BaseUrl
$publisherPrefix = $api.PublisherPrefix
Requires System Administrator or System Customizer security role.
Always query existing tables first before creating:
$existingTables = Invoke-RestMethod -Uri "$baseUrl/EntityDefinitions?`$filter=IsCustomEntity eq true&`$select=SchemaName,LogicalName,DisplayName" -Headers $headers
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:
npx power-apps add-data-source -a dataverse -t <table-logical-name>
Can add multiple tables by running the command for each one.
The command generates:
…
为 Power Apps 代码应用接入 Azure DevOps 连接器,便于查询工单、提报缺陷与管理流水线。
指导你在 Power Apps Studio 中添加数据源或连接器并完成验证。