PL 400 PCF Controls (Power Apps Component Framework) 1 — Questions and Answers
Question 1: What is the primary purpose of the Power Apps Component Framework (PCF)?
- To create custom, reusable UI controls for canvas and model-driven apps (Correct answer)
- To automate business workflows in Power Automate
- To configure Dataverse security roles and permissions
- To build embedded Power BI dashboards within Power Apps
Correct answer: To create custom, reusable UI controls for canvas and model-driven apps
PCF enables pro developers to build custom, reusable UI controls that extend the default controls available in Power Apps canvas and model-driven apps.
Question 2: Which Power Apps CLI command is used to initialize a new PCF component project?
- pac pcf create (Correct answer)
- pac solution create
- pac plugin create
- pac component init
Correct answer: pac pcf create
The `pac pcf create` command scaffolds a new PCF project with the required folder structure, manifest, and TypeScript stub files.
Question 3: Which file serves as the contract between a PCF control and its host application by declaring properties and resources?
- ControlManifest.Input.xml (Correct answer)
- control.config.json
- manifest.yaml
- component.definition.xml
Correct answer: ControlManifest.Input.xml
ControlManifest.Input.xml defines the PCF control's properties, resources, and metadata that the host application uses to bind data and load the control.
Question 4: Which TypeScript interface must every PCF control class implement?
- ComponentFramework.StandardControl<IInputs, IOutputs> (Correct answer)
- ComponentFramework.BaseControl
- IPCFControl<IInputs, IOutputs>
- PowerApps.IControl<IInputs>
Correct answer: ComponentFramework.StandardControl<IInputs, IOutputs>
All PCF controls must implement `ComponentFramework.StandardControl<IInputs, IOutputs>`, which mandates the required lifecycle methods: init, updateView, getOutputs, and destroy.
Question 5: What is the role of the `init` method in a PCF control's lifecycle?
- To create DOM elements, set initial state, and register event listeners the first time the control loads (Correct answer)
- To refresh the control UI whenever a bound property value changes
- To release resources such as timers and event listeners when the control is removed
- To return updated output property values to the host application
Correct answer: To create DOM elements, set initial state, and register event listeners the first time the control loads
The `init` method is invoked exactly once during a control's lifetime and is used to build the initial DOM structure, configure event listeners, and perform any one-time setup.
Question 6: What triggers the PCF framework to call a control's `updateView` method?
- Any change to an input property value or the host environment context (Correct answer)
- A user click event inside the control's DOM container
- A successful Dataverse web API call within the control
- The control calling context.events.notifyOutputChanged()
Correct answer: Any change to an input property value or the host environment context
`updateView` is invoked by the framework whenever an input property value or environment attribute changes, signaling the control to re-render its UI with the latest data.
Question 7: Which tool allows a PCF developer to test a control locally in a browser without deploying it to a Dataverse environment?
- The PCF test harness launched by running `npm start` (Correct answer)
- Power Apps Studio's preview mode
- Visual Studio Code Live Share extension
- Power Platform Admin Center sandbox preview
Correct answer: The PCF test harness launched by running `npm start`
Running `npm start` in a PCF project launches a local test harness — a lightweight browser-based environment that lets developers iterate and debug controls in isolation.
What is the primary purpose of the Power Apps Component Framework (PCF)?