create-code-app

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
References:
  • prerequisites-reference.md - Prerequisites and required permissions
  • troubleshooting.md - Common issues, npm scripts, resources
📋 共享说明:shared-instructions.md - 跨领域相关事项。
参考文档:
  • prerequisites-reference.md - 先决条件与所需权限
  • troubleshooting.md - 常见问题、npm脚本、资源

Create Power Apps Code App

创建Power Apps代码应用

Workflow

工作流程

  1. Prerequisites → 2. Gather Requirements → 3. Plan → 4. Auth & Select Environment → 5. Scaffold → 6. Initialize → 7. Build & Deploy (baseline) → 8. Add Data Sources → 9. Implement App → 10. Final Build & Deploy → 11. Summary

  1. 先决条件 → 2. 收集需求 → 3. 规划 → 4. 身份验证与环境选择 → 5. 搭建项目框架 → 6. 初始化 → 7. 构建与部署(基线版本) → 8. 添加数据源 → 9. 实现应用功能 → 10. 最终构建与部署 → 11. 总结

Step 0: Check Memory Bank

步骤0:检查记忆库

Check for
memory-bank.md
per shared-instructions.md. Skip completed steps.
根据shared-instructions.md检查
memory-bank.md
文件,跳过已完成的步骤。

Step 1: Validate Prerequisites

步骤1:验证先决条件

Run prerequisite checks first -- no point gathering requirements if the environment isn't ready. See prerequisites-reference.md for details.
Check Node.js, the npm CLI package, and Git (runs natively in bash):
bash
node --version                         # Must be v22+
git --version                          # Optional but recommended
Check
pac
CLI via PowerShell — it's a Windows executable not on the bash PATH:
bash
pwsh -NoProfile -Command "pac"  # Used for auth, env selection, code commands
  • Missing Node.js: Report "Install Node.js v22+ from https://nodejs.org/" and STOP.
  • Node.js below v22: Report "Node.js 22+ is required. Please upgrade or switch with
    nvm use 22
    ." and STOP.
  • Missing pac: Report "Install Power Platform CLI from https://aka.ms/PowerAppsCLI" and STOP.
  • Missing Git: Report "Recommended but optional." Continue if approved.
  • All present: Report versions and proceed.
首先运行先决条件检查——如果环境未准备好,收集需求毫无意义。详情请见prerequisites-reference.md
检查Node.js、npm CLI包和Git(在bash中原生运行):
bash
node --version                         # 必须为v22+
git --version                          # 可选但推荐
通过PowerShell检查
pac
CLI——这是Windows可执行文件,不在bash的PATH中:
bash
pwsh -NoProfile -Command "pac"  # 用于身份验证、环境选择、代码相关命令
  • 缺少Node.js:提示“从https://nodejs.org/安装Node.js v22+”并终止流程。
  • Node.js版本低于v22:提示“需要Node.js 22+版本,请升级或使用
    nvm use 22
    切换版本”并终止流程。
  • 缺少pac:提示“从https://aka.ms/PowerAppsCLI安装Power Platform CLI”并终止流程。
  • 缺少Git:提示“推荐安装但非必需”,若用户同意则继续。
  • 所有工具均已安装:报告版本信息并继续。

Step 2: Gather Requirements

步骤2:收集需求

Skip questions the user already answered in their initial instruction.
If the user has not described what they want to build (i.e.,
/create-code-app
was invoked with no arguments or a vague prompt), start with a single open-ended question before asking anything else:
"What would you like to build? Describe it in your own words — what it does, who uses it, and what problem it solves."
Wait for their answer. Use it to frame all follow-up questions. Do NOT present a multiple-choice list of app types before the user has described their idea.
Once you have their description:
  1. Confirm the app name and clarify the purpose if needed
  2. Ask about data -- focus on what the app needs to do, not specific technologies:
    • "What data does your app need to work with?" (e.g., company emails, project tasks, custom business records)
    • "Does your app need to search existing information, manage its own data, or both?"
    • Based on their answers, recommend the best approach:
      • Store and manage custom business data (tables, forms, CRUD) → Dataverse (
        /add-dataverse
        )
      • Interact with specific services (send emails, post messages, manage files) → the appropriate connector
    • If they mention existing Dataverse tables, SharePoint lists, or connectors by name, use those directly
  3. Ask about UI requirements: key screens, layout, interactions, theme preference
  4. Ask any clarifying questions now -- resolve all ambiguity before entering plan mode
跳过用户在初始指令中已回答的问题。
如果用户未描述想要构建的内容(即调用
/create-code-app
时无参数或提示模糊),先提出一个开放式问题,再询问其他内容:
"您想要构建什么样的应用?用您自己的话描述——它的功能、使用人群以及解决的问题。"
等待用户回答,并用该回答引导后续所有问题。在用户描述其想法之前,不要提供应用类型的多选列表。
获取用户描述后:
  1. 确认应用名称,必要时明确应用用途
  2. 询问数据相关问题——聚焦于应用需要实现的功能,而非具体技术:
    • "您的应用需要处理哪些数据?"(例如:公司邮件、项目任务、自定义业务记录)
    • "您的应用需要搜索现有信息、管理自有数据,还是两者兼具?"
    • 根据用户回答推荐最佳方案:
      • 存储和管理自定义业务数据(表格、表单、增删改查)→ Dataverse(
        /add-dataverse
      • 与特定服务交互(发送邮件、发布消息、管理文件)→ 对应的连接器
    • 如果用户提到已有的Dataverse表、SharePoint列表或连接器名称,直接使用这些资源
  3. 询问UI需求:关键页面、布局、交互方式、主题偏好
  4. 提出任何澄清问题——进入规划模式前解决所有歧义

Step 3: Plan

步骤3:规划

  1. Enter plan mode with
    EnterPlanMode
  2. Design the full implementation approach:
    • Which
      /add-*
      skills to run for data sources
    • App architecture: components, pages, state management
    • Feature list with priority order
  3. Present plan for approval, include
    allowedPrompts
    from prerequisites-reference.md
  4. Exit plan mode with
    ExitPlanMode
    when approved
  1. 使用
    EnterPlanMode
    进入规划模式
  2. 设计完整的实现方案:
    • 为数据源运行哪些
      /add-*
      技能
    • 应用架构:组件、页面、状态管理
    • 按优先级排序的功能列表
  3. 提交规划供审批,包含prerequisites-reference.md中的
    allowedPrompts
  4. 获批后使用
    ExitPlanMode
    退出规划模式

Step 4: Auth & Select Environment

步骤4:身份验证与环境选择

bash
pwsh -NoProfile -Command "pac auth list"
If empty, proceed since the command will use system credentials. If profiles are listed, check which environment they target.
If multiple profiles are listed: Notify the user that using Microsoft tenant credentials requires clearing all profiles first, then run:
bash
pwsh -NoProfile -Command "pac auth clear"
After clearing, there is no need to run
auth create
. The tool picks up the system login automatically.
pwsh -NoProfile -Command "pac auth list"
shows the active auth profile with its environment. Check which environment it targets.
  • Environment matches user's target: Confirm and proceed.
  • On a different environment or no target set: Run
    pwsh -NoProfile -Command "pac env list"
    , show up to 10 options, let the user pick, and run
    pwsh -NoProfile -Command "pac env select --environment <id>"
    .
See preferred-environment.md for details.
Critical: Capture the environment ID for Step 7.
bash
pwsh -NoProfile -Command "pac auth list"
如果结果为空,继续执行,因为命令将使用系统凭据。如果列出了配置文件,检查它们指向的环境。
如果列出多个配置文件:通知用户使用Microsoft租户凭据需要先清除所有配置文件,然后运行:
bash
pwsh -NoProfile -Command "pac auth clear"
清除后,无需运行
auth create
,工具会自动获取系统登录信息。
pwsh -NoProfile -Command "pac auth list"
会显示活动的身份验证配置文件及其对应的环境。检查其指向的环境。
  • 环境与用户目标匹配:确认并继续。
  • 环境不符或未设置目标:运行
    pwsh -NoProfile -Command "pac env list"
    ,显示最多10个选项,让用户选择,然后运行
    pwsh -NoProfile -Command "pac env select --environment <id>"
详情请见preferred-environment.md
关键操作:记录步骤7所需的环境ID。

Step 5: Scaffold

步骤5:搭建项目框架

Ask the user for a folder name. Default to
powerapps-{app-name-slugified}-{timestamp}
if they don't have a preference.
IMPORTANT: Use
npx degit
to download the template. Do NOT use
git clone
, do NOT manually create files, do NOT download from GitHub UI.
degit
downloads the template without git history.
powershell
npx degit microsoft/PowerAppsCodeApps/templates/vite {folder} --force
cd {folder}
npm install
Notes:
  • Use
    --force
    to overwrite if the directory already has files (e.g.,
    .claude
    from a planning session)
  • If targeting an existing directory, use
    .
    as the folder name:
    npx degit microsoft/PowerAppsCodeApps/templates/vite . --force
  • If
    npx degit
    fails (network issues, npm not found), retry once, then ask the user to run manually
Verify:
package.json
exists,
node_modules/
created.
向用户询问文件夹名称。如果用户无偏好,默认使用
powerapps-{app-name-slugified}-{timestamp}
重要提示:使用
npx degit
下载模板。请勿使用
git clone
,请勿手动创建文件,请勿从GitHub UI下载。
degit
会下载无Git历史的模板。
powershell
npx degit microsoft/PowerAppsCodeApps/templates/vite {folder} --force
cd {folder}
npm install
注意事项:
  • 使用
    --force
    覆盖目录中已有的文件(例如:规划会话中生成的
    .claude
  • 如果目标是现有目录,使用
    .
    作为文件夹名称:
    npx degit microsoft/PowerAppsCodeApps/templates/vite . --force
  • 如果
    npx degit
    失败(网络问题、未找到npm),重试一次,然后请用户手动运行
验证:确认
package.json
存在,
node_modules/
已创建。

Step 6: Initialize

步骤6:初始化

bash
pwsh -NoProfile -Command "pac code init --displayName '{user-provided-app-name}' -e <environment-id>"
pac code init
failure:
  • Non-zero exit: Report the exact output and STOP. Do not continue to Step 7.
  • "environmentId not found": Confirm the environment ID from Step 4 and retry with the correct
    -e
    value.
  • Example: "The
    pac code init
    command failed:
    [error text]
    . Please check that environment ID
    32a51012-...
    is correct and that you have maker permissions in that environment."
Critical: Read
power.config.json
and verify
environmentId
matches Step 4. Update if mismatched (common issue).
bash
pwsh -NoProfile -Command "pac code init --displayName '{user-provided-app-name}' -e <environment-id>"
pac code init
失败处理:
  • 非零退出码:报告确切输出并终止流程,不要继续执行步骤7。
  • "environmentId not found":确认步骤4中的环境ID,使用正确的
    -e
    值重试。
  • 示例:"
    pac code init
    命令失败:
    [错误文本]
    。请检查环境ID
    32a51012-...
    是否正确,以及您是否拥有该环境的制作者权限。"
关键操作:读取
power.config.json
并验证
environmentId
是否与步骤4中的一致。如果不匹配则更新(常见问题)。

Step 7: Build & Deploy (baseline)

步骤7:构建与部署(基线版本)

Pre-approved: This baseline deploy is part of the scaffold flow and does not require a separate confirmation prompt.
Build and deploy the bare template to verify the pipeline works before adding data sources.
powershell
npm run build
Verify
dist/
folder created with
index.html
and
assets/
.
bash
pwsh -NoProfile -Command "pac code push"
Capture app URL from output:
https://apps.powerapps.com/play/e/{env-id}/app/{app-id}
Common deploy errors: See troubleshooting.md.
Create or update
memory-bank.md
in the project root now
-- don't wait until the end. Include:
  • Project path, app name, environment ID, app URL
  • Completed steps: scaffold, init, baseline deploy
  • Data sources planned (from Step 2)
  • Version: v1.0.0
This ensures progress is saved even if the session ends unexpectedly.
预批准:此基线部署是框架搭建流程的一部分,无需单独确认提示。
在添加数据源之前,构建并部署基础模板以验证流水线是否正常工作。
powershell
npm run build
验证
dist/
文件夹是否已创建,且包含
index.html
assets/
bash
pwsh -NoProfile -Command "pac code push"
从输出中捕获应用URL
https://apps.powerapps.com/play/e/{env-id}/app/{app-id}
常见部署错误:请见troubleshooting.md
立即在项目根目录创建或更新
memory-bank.md
——不要等到流程结束。包含以下内容:
  • 项目路径、应用名称、环境ID、应用URL
  • 已完成步骤:框架搭建、初始化、基线部署
  • 规划的数据源(来自步骤2)
  • 版本:v1.0.0
这可确保即使会话意外终止,进度也能保存。

Step 8: Add Data Sources

步骤8:添加数据源

Invoke the
/add-*
skills identified in the plan (Step 3). Run each in sequence. Pass context as arguments so sub-skills skip redundant questions (project path, connector name, etc.):
App needs to...Invoke
Store/manage custom business data
/add-dataverse
Track work items, bugs, pipelines
/add-azuredevops
Send or read Teams messages
/add-teams
Read/write Excel spreadsheet data
/add-excel
Upload, download, or manage files
/add-onedrive
Work with SharePoint lists or docs
/add-sharepoint
Send emails, read inbox, manage calendar
/add-office365
Invoke a Copilot Studio agent
/add-mcscopilot
Connect to another service
/add-connector
Each
/add-*
skill runs
npm run build
to catch errors. Do NOT deploy yet.
If no data sources needed: Skip to Step 9.
调用步骤3(规划)中确定的
/add-*
技能,依次运行每个技能。传递上下文作为参数,以便子技能跳过重复问题(项目路径、连接器名称等):
应用需要...调用命令
存储/管理自定义业务数据
/add-dataverse
跟踪工作项、缺陷、流水线
/add-azuredevops
发送或读取Teams消息
/add-teams
读写Excel电子表格数据
/add-excel
上传、下载或管理文件
/add-onedrive
处理SharePoint列表或文档
/add-sharepoint
发送邮件、读取收件箱、管理日历
/add-office365
调用Copilot Studio代理
/add-mcscopilot
连接到其他服务
/add-connector
每个
/add-*
技能都会运行
npm run build
以捕获错误,暂不部署。
如果无需数据源:跳至步骤9。

Step 9: Implement App

步骤9:实现应用功能

This is the core step. Build the actual app features described in the plan from Step 3.
  1. Review generated services: Use
    Grep
    to find methods in generated service files (they can be very large -- see connector-reference.md). Do NOT read entire generated files.
  2. Build components: Create React components for each screen/feature in the plan
  3. Connect data: Wire components to generated services (use
    *Service.getAll()
    ,
    *Service.create()
    , etc.)
  4. Apply theme: Use the user's theme preference (default: dark theme per development standards)
  5. Add version display: Show app version in the UI (per development standards)
  6. Iterate with user: Show progress, ask for feedback, adjust as needed
Key rules:
  • Use generated services for all data access -- never use fetch/axios directly
  • Read dataverse-reference.md if working with Dataverse (picklist fields, virtual fields, lookups have critical gotchas)
  • Remove unused imports before building (TS6133 strict mode)
  • Don't edit files in
    src/generated/
    unless fixing known issues
这是核心步骤。根据步骤3(规划)中的方案构建实际的应用功能。
  1. 查看生成的服务:使用
    Grep
    查找生成的服务文件中的方法(这些文件可能非常大——请见connector-reference.md)。请勿读取整个生成文件。
  2. 构建组件:为方案中的每个页面/功能创建React组件
  3. 连接数据:将组件与生成的服务关联(使用
    *Service.getAll()
    *Service.create()
    等方法)
  4. 应用主题:使用用户偏好的主题(默认:符合开发标准的深色主题)
  5. 添加版本显示:在UI中显示应用版本(符合开发标准)
  6. 与用户迭代:展示进度、征求反馈、按需调整
关键规则:
  • 所有数据访问均使用生成的服务——切勿直接使用fetch/axios
  • 如果使用Dataverse,请阅读dataverse-reference.md(选择列表字段、虚拟字段、查找存在关键注意事项)
  • 构建前移除未使用的导入(TS6133严格模式)
  • 除非修复已知问题,否则不要编辑
    src/generated/
    中的文件

Step 10: Final Build & Deploy

步骤10:最终构建与部署

powershell
npm run build
Fix any TypeScript errors. Verify
dist/
contains the updated app.
Ask the user: "Ready to deploy to [environment name]? This will update the live app." Wait for explicit confirmation before proceeding.
bash
pwsh -NoProfile -Command "pac code push"
Increment version (e.g., v1.0.0 → v1.1.0) and update version display in the app.
powershell
npm run build
修复所有TypeScript错误,验证
dist/
包含更新后的应用。
询问用户:"是否准备部署到[环境名称]?这将更新线上应用。" 继续执行前等待用户明确确认。
bash
pwsh -NoProfile -Command "pac code push"
递增版本号(例如:v1.0.0 → v1.1.0)并更新应用中的版本显示。

Step 11: Summary

步骤11:总结

Provide:
  • App name, environment, app URL, project location
  • Version deployed
  • What was built: features, data sources, components
  • Next steps: how to iterate (
    npm run build && pac code push
    ), how to add more data sources
  • Suggest what else the app could do:
    • /add-datasource
      -- add another data source (describe what you need, and the plugin will recommend the best approach)
    • /add-dataverse
      -- store and manage custom business data
    • /add-azuredevops
      -- track work items, bugs, and pipelines
    • /add-teams
      -- send and read Teams messages
    • /add-sharepoint
      -- work with SharePoint lists or documents
    • /add-office365
      -- send emails, manage calendar
    • /add-connector
      -- connect to any other service
  • Manage at https://make.powerapps.com/environments/<environment-id>/home
提供以下内容:
  • 应用名称、环境、应用URL、项目位置
  • 已部署版本
  • 构建内容:功能、数据源、组件
  • 后续步骤:如何迭代(
    npm run build && pac code push
    )、如何添加更多数据源
  • 应用可扩展的功能建议:
    • /add-datasource
      — 添加另一个数据源(描述您的需求,插件将推荐最佳方案)
    • /add-dataverse
      — 存储和管理自定义业务数据
    • /add-azuredevops
      — 跟踪工作项、缺陷和流水线
    • /add-teams
      — 发送和读取Teams消息
    • /add-sharepoint
      — 处理SharePoint列表或文档
    • /add-office365
      — 发送邮件、管理日历
    • /add-connector
      — 连接到任何其他服务
  • 管理地址:https://make.powerapps.com/environments/<environment-id>/home

Update Memory Bank

更新记忆库

Update the memory bank (created in Step 7) with final state:
  • All completed steps (scaffold, data sources, implementation, deploy)
  • Features implemented and components created
  • Data sources connected
  • Current version
  • Suggested next steps

使用最终状态更新步骤7中创建的记忆库:
  • 所有已完成步骤(框架搭建、数据源、功能实现、部署)
  • 已实现的功能和创建的组件
  • 已连接的数据源
  • 当前版本
  • 建议的后续步骤

Example Walkthroughs

示例演练

These walkthroughs show the full sequence from user request to final output — commands run, files changed, and the verbatim summary format the assistant should use.

这些演练展示了从用户请求到最终输出的完整流程——运行的命令、修改的文件,以及助手应使用的准确总结格式。

Example 1: Create a Task Tracker App with Dataverse

示例1:使用Dataverse创建任务跟踪器应用

User request:
"Build me a simple task tracker that stores tasks in Dataverse. I want to add tasks, mark them complete, and see a list."
Commands run (in order):
bash
undefined
用户请求:
"帮我构建一个简单的任务跟踪器,将任务存储在Dataverse中。我想要添加任务、标记任务完成,并查看任务列表。"
运行的命令(按顺序):
bash
undefined

Step 1: Prerequisites

步骤1:先决条件

node --version # → v22.4.0 pwsh -NoProfile -Command "pac" # verify installed
node --version # → v22.4.0 pwsh -NoProfile -Command "pac" # 验证是否已安装

Step 4: Auth

步骤4:身份验证

pwsh -NoProfile -Command "pac auth list" # → verify active environment
pwsh -NoProfile -Command "pac auth list" # → 验证活动环境

Step 5: Scaffold

步骤5:搭建框架

npx degit microsoft/PowerAppsCodeApps/templates/vite powerapps-task-tracker-20260302 --force cd powerapps-task-tracker-20260302 npm install
npx degit microsoft/PowerAppsCodeApps/templates/vite powerapps-task-tracker-20260302 --force cd powerapps-task-tracker-20260302 npm install

Step 6: Initialize

步骤6:初始化

pwsh -NoProfile -Command "pac code init --displayName 'Task Tracker' -e <environment-id>"
pwsh -NoProfile -Command "pac code init --displayName 'Task Tracker' -e <environment-id>"

Step 7: Baseline deploy (pre-approved as part of scaffold flow)

步骤7:基线部署(作为框架搭建流程的一部分已预批准)

npm run build pwsh -NoProfile -Command "pac code push"
npm run build pwsh -NoProfile -Command "pac code push"

Step 8: Add Dataverse (via /add-dataverse)

步骤8:添加Dataverse(通过/add-dataverse)

pwsh -NoProfile -Command "pac code add-data-source -a dataverse -t cr123_task" npm run build # verify connector — no deploy yet
pwsh -NoProfile -Command "pac code add-data-source -a dataverse -t cr123_task" npm run build # 验证连接器 — 暂不部署

Step 10: Final deploy (requires user confirmation)

步骤10:最终部署(需要用户确认)

npm run build pwsh -NoProfile -Command "pac code push"

**Files changed:**

| File                                          | Change                                                |
| --------------------------------------------- | ----------------------------------------------------- |
| `power.config.json`                           | Created by `pac code init` — contains `environmentId` |
| `src/generated/models/Cr123_taskModel.ts`     | Generated by `pac code add-data-source`               |
| `src/generated/services/Cr123_taskService.ts` | Generated by `pac code add-data-source`               |
| `src/components/TaskList.tsx`                 | Created — renders task list with status filter        |
| `src/components/AddTaskForm.tsx`              | Created — form to add new tasks                       |
| `src/App.tsx`                                 | Updated — wires components to `Cr123_taskService`     |
| `memory-bank.md`                              | Created in Step 7, updated in Step 11                 |

**Final assistant summary (verbatim format):**
Task Tracker is live.
App: Task Tracker v1.0.0 Environment: <your-environment-name> (<environment-id>) URL: https://apps.powerapps.com/play/e/<environment-id>/app/<app-id> Project: ~/powerapps-task-tracker-20260302/
What was built:
  • Task list view with Active / Completed filter
  • Add task form (title, description, due date)
  • Mark complete / delete actions
  • Dataverse table
    cr123_task
    (Title, Description, DueDate, IsComplete)
To redeploy: npm run build && pac code push (from the project folder)
What you can add next:
  • /add-teams — post task updates to a Teams channel
  • /add-office365 — send email notifications on completion

**What to record in `memory-bank.md`:**

```markdown
npm run build pwsh -NoProfile -Command "pac code push"

**修改的文件:**

| 文件                                          | 变更内容                                                |
| --------------------------------------------- | ----------------------------------------------------- |
| `power.config.json`                           | 由`pac code init`创建 — 包含`environmentId` |
| `src/generated/models/Cr123_taskModel.ts`     | 由`pac code add-data-source`生成               |
| `src/generated/services/Cr123_taskService.ts` | 由`pac code add-data-source`生成               |
| `src/components/TaskList.tsx`                 | 创建 — 渲染带状态筛选的任务列表        |
| `src/components/AddTaskForm.tsx`              | 创建 — 添加新任务的表单                       |
| `src/App.tsx`                                 | 更新 — 将组件与`Cr123_taskService`关联     |
| `memory-bank.md`                              | 步骤7中创建,步骤11中更新                 |

**助手最终总结(准确格式):**
任务跟踪器已上线。
应用:Task Tracker v1.0.0 环境:<您的环境名称> (<环境ID>) URL:https://apps.powerapps.com/play/e/<环境ID>/app/<应用ID> 项目:~/powerapps-task-tracker-20260302/
构建内容:
  • 带“活跃/已完成”筛选的任务列表视图
  • 添加任务表单(标题、描述、截止日期)
  • 标记完成/删除操作
  • Dataverse表
    cr123_task
    (标题、描述、截止日期、是否完成)
重新部署方式:在项目文件夹中运行 npm run build && pac code push
后续可添加功能:
  • /add-teams — 将任务更新发布到Teams频道
  • /add-office365 — 任务完成时发送邮件通知

**`memory-bank.md`中记录的内容:**

```markdown

Task Tracker — Memory Bank

任务跟踪器 — 记忆库

Project

项目

  • Path: ~/powerapps-task-tracker-20260302/
  • App name: Task Tracker
  • Environment: <your-environment-name> (<environment-id>)
  • App URL: https://apps.powerapps.com/play/e/<environment-id>/app/<app-id>
  • Version: v1.0.0
  • 路径:~/powerapps-task-tracker-20260302/
  • 应用名称:Task Tracker
  • 环境:<您的环境名称> (<环境ID>)
  • 应用URL:https://apps.powerapps.com/play/e/<环境ID>/app/<应用ID>
  • 版本:v1.0.0

Completed Steps

已完成步骤

  • Prerequisites validated
  • Scaffold (npx degit)
  • Initialize (pac code init)
  • Baseline deploy
  • Add Dataverse (cr123_task)
  • Implement app (TaskList, AddTaskForm)
  • Final deploy
  • 验证先决条件
  • 搭建框架(npx degit)
  • 初始化(pac code init)
  • 基线部署
  • 添加Dataverse(cr123_task)
  • 实现应用功能(TaskList、AddTaskForm)
  • 最终部署

Data Sources

数据源

  • Dataverse: cr123_task (Title, Description, DueDate, IsComplete)
  • Dataverse: cr123_task(标题、描述、截止日期、是否完成)

Components

组件

  • TaskList.tsx — filtered list, mark complete, delete
  • AddTaskForm.tsx — create new tasks
  • TaskList.tsx — 筛选列表、标记完成、删除
  • AddTaskForm.tsx — 创建新任务

Next Steps

后续步骤

  • Consider /add-teams for task assignment notifications

---
  • 考虑使用/add-teams实现任务分配通知

---

Example 2: Add SharePoint Connector to an Existing App

示例2:为现有应用添加SharePoint连接器

User request:
"My app already exists. Add SharePoint so I can read items from a list called 'Project Milestones'."
Commands run (in order):
bash
undefined
用户请求:
"我的应用已存在。添加SharePoint连接器,以便我可以读取名为'项目里程碑'的列表中的项。"
运行的命令(按顺序):
bash
undefined

Step 6: Get connection ID (via /list-connections)

步骤6:获取连接ID(通过/list-connections)

pwsh -NoProfile -Command "pac connection list"
pwsh -NoProfile -Command "pac connection list"

→ ConnectionId: conn-sp-xyz789 (SharePoint Online)

→ 连接ID: conn-sp-xyz789 (SharePoint Online)

Step 7: Discover sites

步骤7:发现站点

pwsh -NoProfile -Command "pac code list-datasets -a sharepointonline -c conn-sp-xyz789"
pwsh -NoProfile -Command "pac code list-datasets -a sharepointonline -c conn-sp-xyz789"

Step 8: Discover tables

步骤8:发现表格

pwsh -NoProfile -Command "pac code list-tables -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects'"
pwsh -NoProfile -Command "pac code list-tables -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects'"

→ Project Milestones, Documents, Team Wiki

→ 项目里程碑、文档、团队维基

Step 9: Add connector

步骤9:添加连接器

pwsh -NoProfile -Command "pac code add-data-source -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects' -t 'Project Milestones'"
pwsh -NoProfile -Command "pac code add-data-source -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects' -t '项目里程碑'"

Step 11: Build to verify

步骤11:构建验证

npm run build # → success

**Files changed:**

| File                                                | Change                                            |
| --------------------------------------------------- | ------------------------------------------------- |
| `src/generated/services/SharePointOnlineService.ts` | Generated — contains `GetItems`, `PostItem`, etc. |
| `src/generated/models/SharePointOnlineModel.ts`     | Generated — TypeScript interfaces                 |
| `.power/schemas/sharepointonline/`                  | Generated schema files                            |
| `memory-bank.md`                                    | Updated — connector recorded                      |

**Final assistant summary (verbatim format):**
SharePoint Online connector added.
Connector: SharePoint Online Site: https://contoso.sharepoint.com/sites/Projects List: Project Milestones Build: Passed ✓
Usage: const result = await SharePointOnlineService.GetItems({ dataset: "https://contoso.sharepoint.com/sites/Projects", table: "Project Milestones" }); const milestones = result.data?.value || [];
Next: Implement your UI components using the generated service, then run /deploy when ready.
undefined
npm run build # → 成功

**修改的文件:**

| 文件                                                | 变更内容                                            |
| --------------------------------------------------- | ------------------------------------------------- |
| `src/generated/services/SharePointOnlineService.ts` | 生成 — 包含`GetItems`、`PostItem`等方法 |
| `src/generated/models/SharePointOnlineModel.ts`     | 生成 — TypeScript接口                 |
| `.power/schemas/sharepointonline/`                  | 生成的架构文件                            |
| `memory-bank.md`                                    | 更新 — 记录连接器                      |

**助手最终总结(准确格式):**
已添加SharePoint Online连接器。
连接器:SharePoint Online 站点:https://contoso.sharepoint.com/sites/Projects 列表:项目里程碑 构建:已通过 ✓
使用方式: const result = await SharePointOnlineService.GetItems({ dataset: "https://contoso.sharepoint.com/sites/Projects", table: "项目里程碑" }); const milestones = result.data?.value || [];
下一步:使用生成的服务实现UI组件,准备就绪后运行/deploy。
undefined