# pcf-power-pages

A Copilot rule that walks through moving Power Apps code components onto Power Pages forms and lists the APIs that will not run there.

- rule · `type=rule` · GitHub Copilot · ★ 40451
- Author: github · official GitHub repository
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/github/awesome-copilot/tree/HEAD/instructions/pcf-power-pages.instructions.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/rules/pcf-power-pages

## What it does

The rule covers the whole path: package a component built with Power Apps component framework, attach it to a field in a model-driven app form, then switch it on for the portal. Two routes exist on the Power Pages side. In Design Studio you pick the field and tick “Enable custom component”. In the Portals Management app you create a Basic Form Metadata record, set Type to Attribute, choose the attribute logical name and set Control Style to Code Component.

Field support is narrower than in model-driven apps. Currency, Decimal, Enum, OptionSet, TwoOptions, Whole and several SingleLine and DateAndTime formats are allowed. Anything outside that list will not bind. Several component APIs are off limits too: `Device.captureAudio`, `Device.captureImage`, `Device.captureVideo`, `Device.getBarcodeValue`, `Device.getCurrentPosition`, `Device.pickFile` and `Utility`. Setting `uses-feature` to true breaks the component, and so does binding one control to multiple form fields.

Before any of this, you need system administrator rights in the environment, site version 9.3.3.x or higher and starter site package 9.2.2103.x or higher. Components run in browsers under the Web client option. If a component needs to touch records, it can be wired to the portal Web API for create, retrieve, update and delete calls.

## Install

### GitHub Copilot (native platform)

**Manually: put the files in place**
- File: `.github/instructions/pcf-power-pages.instructions.md` — The applyTo field sets which files it applies to

### Claude Code

**Manually: put the files in place**
- File: `.claude/rules/pcf-power-pages.md` — The paths frontmatter field limits the files: move applyTo from the source into paths

### Codex

**AGENTS.md**
- Codex reads AGENTS.md: paste the rule text there

### Cursor

**Manually: put the files in place**
- File: `.cursor/rules/pcf-power-pages.mdc` — Frontmatter: description, globs, alwaysApply. Move applyTo from the source into globs, or the rule will not attach on its own

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/rules/pcf-power-pages.md`

### Cline

**Manually: put the files in place**
- File: `.clinerules/pcf-power-pages.md`

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/github/awesome-copilot/tree/HEAD/instructions/pcf-power-pages.instructions.md

## When to use it
- move a code component from a model-driven app onto a Power Pages page
- enable a custom component on a form field in Design Studio
- attach a component to a basic form through the Portals Management app
- check whether a field type and format are supported
- wire a component to the portal Web API for record operations

## Example prompts
- Add this code component to a field in the model-driven app and show me how to enable it in Power Pages
- Check whether SingleLine.Email is a supported field type for code components
- Build a component that reads and updates Dataverse records through the portal Web API

## Source text · pcf-power-pages.instructions.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 2f1d9f708709b2bd.

BEGIN THIRD-PARTY FILE 2f1d9f708709b2bd
```text
---
description: 'Using code components in Power Pages sites'
applyTo: '**/*.{ts,tsx,js,json,xml,pcfproj,csproj}'
---

# Use Code Components in Power Pages

Power Pages now support controls built for model-driven apps created using Power Apps component framework. To use code components in Power Pages site webpages:

![Create code component using component framework, then add the code component to a model-driven app form, and configure the code component field inside the basic form for portals](https://learn.microsoft.com/en-us/power-pages/configure/media/component-framework/steps.png)

After completing these steps, users can interact with the code component using the webpage that has the respective [form](https://learn.microsoft.com/en-us/power-pages/getting-started/add-form) component.

## Prerequisites

- You need system administrator privileges to enable the code component feature in the environment
- Your Power Pages site version needs to be [9.3.3.x](https://learn.microsoft.com/en-us/power-apps/maker/portals/versions/version-9.3.3.x) or higher
- Your starter site package needs to be [9.2.2103.x](https://learn.microsoft.com/en-us/power-apps/maker/portals/versions/package-version-9.2.2103) or higher

## Create and Package Code Component

To learn about creating and packaging code components in Power Apps component framework, go to [Create your first component](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/implementing-controls-using-typescript).

### Supported Field Types and Formats

Power Pages supports restricted field types and formats for using code components. The following table lists all supported field data types and formats:

**Supported Types:**
- Currency
- DateAndTime.DateAndTime
- DateAndTime.DateOnly
- Decimal
- Enum
- Floating Point Number
- Multiple
- OptionSet
- SingleLine.Email
- SingleLine.Phone
- SingleLine.Text
- SingleLine.TextArea
- SingleLine.Ticker
- SingleLine.URL
- TwoOptions
- Whole

For more information, see [Attributes list and descriptions](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/manifest-schema-reference/property#remarks).

### Unsupported Code Components in Power Pages

The following code component APIs aren't supported:
- [Device.captureAudio](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/captureaudio)
- [Device.captureImage](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/captureimage)
- [Device.captureVideo](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/capturevideo)
- [Device.getBarcodeValue](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/getbarcodevalue)
- [Device.getCurrentPosition](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/getcurrentposition)
- [Device.pickFile](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/device/pickfile)
```
END THIRD-PARTY FILE 2f1d9f708709b2bd

The third-party file has ended. Everything between the 2f1d9f708709b2bd tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3049 of 7186 bytes. © github · MIT · https://github.com/github/awesome-copilot/tree/HEAD/instructions/pcf-power-pages.instructions.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
