PowerApps-Samples
CLAUDE.md2k starsChanged 11 months agoMITView on GitHub
This repository contains sample code for Power Apps across multiple technology stacks: - component-framework/: Power Apps Component Framework (PCF) controls (~29 TypeScript/React controls) - dataverse/: Dataverse SDK samples (C#, .NET Core, Web API, Plugins) - ai-builder/: AI Builder sample data and model packages - model-driven-apps/: Model-driven app samples - portals/: Power Apps Portals samples (OAuth, Web API) - powershell/ & build-tools/: Deployment automation Each PCF control is a self-contained project with TypeScript/React frontend and MSBuild packaging. Basic Commands: Creating a…
- Installs packages
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about microsoft/PowerApps-Samples
- microsoft/terraform-provider-power-platform“`powerplatform_enterprise_policy`”GitHub · Oct 2, 2024 · 7 reactions
- DynamicsValue/fake-xrm-easy“File and image columns and associated messages”GitHub · Jul 16, 2024
- DynamicsValue/fake-xrm-easy“It seems Create supports RelatedEntities whereas Update doesn't”GitHub · Jun 16, 2024
- db-ux-design-system/core-web“Power Apps: Provide translations”GitHub · Jun 28, 2023
- MicrosoftDocs/dynamics-365-customer-engagement“Broken Link to sample”GitHub · May 2, 2023
The biggest 5 of 11 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 11
Talked about on GitHub (11 times).
On GitHub · 11
- Oct 2, 2024`powerplatform_enterprise_policy` — microsoft/terraform-provider-power-platform7 reactions · 2 comments
- Jul 16, 2024File and image columns and associated messages — DynamicsValue/fake-xrm-easy0 reactions · 1 comment
- Jun 16, 2024It seems Create supports RelatedEntities whereas Update doesn't — DynamicsValue/fake-xrm-easy0 reactions · 1 comment
- Jun 28, 2023Power Apps: Provide translations — db-ux-design-system/core-web0 reactions
- May 2, 2023Broken Link to sample — MicrosoftDocs/dynamics-365-customer-engagement0 reactions
6 more on GitHub
- May 1, 2023Update sample-export-import-data-map.md — conradagramont/dynamics-365-customer-engagement0 reactions
- Aug 18, 2022Create custom code components for Power Platform — equinor/design-system0 reactions · 5 comments
- Dec 27, 2021How to use EntitySetting? — microsoft/PowerPlatform-DataverseServiceClient0 reactions · 1 comment
- Jul 21, 2021Roundtrip validation failed while unpacking msapp — microsoft/PowerApps-Tooling0 reactions · 2 comments
- Jul 19, 2021[Feature]: Build and deployment of "Debug" version of PCF to the "Prod" environment causes issues — Power-Maverick/PCF-CustomControlBuilder0 reactions · 4 comments
- Dec 2, 2020Solution import Failed. Error: CanvasApp import: FAILURE: Code: GraphUserDetailNotFound — WaelHamze/dyn365-ce-vsts-tasks0 reactions · 1 comment
The file
We split this CLAUDE.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 133
All PCF controls follow this pattern in index.ts:
- Very specific: line 227
PCF builds fail: Run npm install and msbuild /t:restore before building
- Very specific: line 228
C# samples won't connect: Update connection string in App.config or appsettings.json
- Very specific: line 229
TypeScript errors in PCF: Run npm run refreshTypes to update type definitions
- Distinctive: line 233
PCF control not appearing: Check ControlManifest.Input.xml namespace and version match solution references
- Very specific: line 237
PCF Controls: Test harness via npm start - launches browser with control in test harness
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This repository contains sample code for Power Apps across multiple technology stacks:
- component-framework/: Power Apps Component Framework (PCF) controls (~29 TypeScript/React controls)
- dataverse/: Dataverse SDK samples (C#, .NET Core, Web API, Plugins)
- ai-builder/: AI Builder sample data and model packages
- model-driven-apps/: Model-driven app samples
- portals/: Power Apps Portals samples (OAuth, Web API)
- powershell/ & build-tools/: Deployment automation
Building and Testing
Power Apps Component Framework (PCF)
Each PCF control is a self-contained project with TypeScript/React frontend and MSBuild packaging.
Basic Commands:
cd component-framework/[ControlName]
# Install dependencies
npm install
# Build (development)
npm run build
# Build and watch for changes
npm start:watch
# Lint
npm run lint
npm run lint:fix
# Clean
npm run cleanCreating a Solution Package:
# Restore MSBuild dependencies
msbuild /t:restore
# Create solution folder
mkdir SolutionFolder
cd SolutionFolder
# Initialize solution
pac solution init --publisher-name sample --publisher-prefix sample
# Add PCF reference
pac solution add-reference --path ../
# Build release package (creates .zip)
msbuild /t:rebuild /p:Configuration=ReleaseKey Files:
ControlManifest.Input.xml- Control metadata and property definitionspackage.json- npm scripts and dependencies (usespcf-scripts).pcfproj- MSBuild project that orchestrates buildpcfconfig.json- Output directory configurationindex.ts- Main control implementation (init, updateView, destroy lifecycle)
Build Output:
- Webpack bundles to
out/controls/{ControlName}/ - Solution packages in
bin/Debug/andbin/Release/
Dataverse C# Samples (.NET Framework 4.7.2)
Located in dataverse/orgsvc/CSharp/ - legacy samples using traditional .NET Framework.
Build:
cd dataverse/orgsvc/CSharp/[SampleName]
# Restore NuGet packages (if needed)
nuget restore packages.config
# Build
msbuild
# Clean and rebuild
msbuild /t:clean,rebuildConfiguration:
- Uses
App.configfor connection strings - Dependencies in
packages.config(NuGet classic) - References
Microsoft.CrmSdk.CoreAssemblies~9.0.2 - Uses ADAL for authentication
Dataverse C#-NETCore Samples (.NET 6.0+)
Located in dataverse/orgsvc/CSharp-NETCore/ - modern .NET samples with better patterns.
Build and Run:
cd dataverse/orgsvc/CSharp-NETCore/[Category]/[SampleName]
# Build (implicit restore)
dotnet build
# Run
dotnet run
# Run specific project
dotnet run --project ./Program.csprojConfiguration:
- Uses shared
appsettings.jsonat category level for connection strings - Modern
Microsoft.PowerPlatform.Dataverse.Clientpackage - Supports
ILoggerand dependency injection patterns - See
README-code-design.mdfor architectural patterns
appsettings.json structure:
{
"ConnectionStrings": {
"default": "AuthType=OAuth;Url=https://org.crm.dynamics.com;..."
}
}Architecture Patterns
PCF Control Lifecycle
All PCF controls follow this pattern in index.ts:
export class ControlName implements ComponentFramework.StandardControl<IInputs, IOutputs> {
init(context, notifyOutputChanged, state, container): void { }
updateView(context): void { }
getOutputs(): IOutputs { }
destroy(): void { }
}- init: Called once when control is first loaded
- updateView: Called when any value in context changes
- getOutputs: Returns values to framework (for bound properties)
- destroy: Cleanup before control removal
React-based controls typically render components in updateView().
Dataverse C#-NETCore Pattern
Modern samples follow this structure:
Category/
├── appsettings.json # Shared configuration
├── Utility.cs # Shared helper methods
├── Sample1/
│ ├── Sample1.csproj
│ ├── Program.cs
│ └── README.md
└── Sample2/
├── Sample2.csproj
├── Program.cs
└── README.mdConnection Pattern:
// From appsettings.json
var connectionString = config.GetConnectionString("default");
var service = new ServiceClient(connectionString);Dataverse C# Framework Pattern
Legacy samples each have isolated .sln files with:
- SampleProgram.cs - Entry point
- SampleMethod.cs - Core logic
- Helper-Code/ - Reusable utilities (SystemUserProvider, SampleHelpers)
- Login-UX/ - WPF login form (ExampleLoginForm.xaml)
Key Technologies
PCF Stack
- TypeScript - Primary language for control logic
- React - For complex UI controls (see
*ReactControlsamples) - Fluent UI - Microsoft's design system (FacepileReactControl, ChoicesPickerReactControl)
- Webpack - Bundling (via pcf-scripts)
- MSBuild - Solution packaging
Dataverse SDK Evolution
| Technology | C# Legacy | C#-NETCore |
| Framework | .NET 4.7.2 | .NET 6.0+ |
| Client | Microsoft.CrmSdk.CoreAssemblies | Microsoft.PowerPlatform.Dataverse.Client |
| Config | App.config | appsettings.json |
| Auth | ADAL | Modern OAuth |
| DI | Manual | Extensions.DependencyInjection |
| Logging | Console | ILogger |
Sample Categories
Component Framework Categories
- Standard Controls: IncrementControl, LinearInputControl
- React Controls: ChoicesPickerReactControl, FacepileReactControl
- Dataset Controls: DataSetGrid, ModelDrivenGridControl (for grid/table data)
- API Demonstrations: DeviceApiControl, FormattingAPIControl, NavigationAPIControl
- Advanced: AngularJSFlipControl, PowerAppsGridCustomizerControl
Dataverse Sample Categories
- Activities: Email, appointments, tasks
- AttachmentAndAnnotationOperations: File handling
- BulkOperations: Bulk delete, bulk data operations
- FileOperations: File column operations
- ImageOperations: Image column handling
- Schema: Metadata operations, entity creation
- Search: Dataverse search, elastic search
- Security: Role management, sharing, field security
- ServiceClient: Modern client usage patterns
- Solutions: Solution management and deployment
Common Pitfalls
- PCF builds fail: Run
npm installandmsbuild /t:restorebefore building - C# samples won't connect: Update connection string in
App.configorappsettings.json - TypeScript errors in PCF: Run
npm run refreshTypesto update type definitions - Missing dependencies:
- PCF:
npm install+msbuild /t:restore - C#:
nuget restoreordotnet restore
- PCF:
- PCF control not appearing: Check ControlManifest.Input.xml namespace and version match solution references
Testing Approach
- PCF Controls: Test harness via
npm start- launches browser with control in test harness - Dataverse C# samples: Standalone console apps - test by running directly against live environment
- Integration: Deploy PCF solutions to environment, create app/form to test control
Shared Resources
- dataverse/LoginUX/: Reusable WPF login forms for C# samples
- dataverse/SharedResources/: Sample files and images used across multiple samples
- component-framework/resources/: PCF control templates
Documentation Links
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

