PCF Controls (Power Apps Component Framework) Flashcards
7 cards from real PL 400 practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 PCF Controls (Power Apps Component Framework) flashcards as text
In the `updateView` method signature, which parameter provides access to the control's current input property values and all framework services?
Answer: context
The `context` parameter of type `ComponentFramework.Context` exposes `context.parameters` for property values plus all framework service APIs such as webAPI, formatting, and client.
How does a PCF control signal to the host application that an output property value has changed?
Answer: By calling context.events.notifyOutputChanged()
Calling `context.events.notifyOutputChanged()` tells the framework that output values have changed; the framework then calls `getOutputs()` to retrieve the new values and propagates them to the host.
What is the purpose of the `getOutputs` method in a PCF control?
Answer: To return a snapshot of all current output property values to the framework after notifyOutputChanged is called
`getOutputs` is called by the framework in response to `notifyOutputChanged()` and must return an object whose keys match the output properties defined in the manifest.
Which ControlManifest.Input.xml element declares each bindable property, its data type, and its usage direction?
Answer:
The `` element in ControlManifest.Input.xml defines each control property with attributes such as name, of-type, usage (bound/input), and required.
What is the key architectural difference between a 'field' type and a 'dataset' type PCF component?
Answer: Field components bind to a single scalar value; dataset components bind to a collection of records with columns
Field-type controls replace a single-field control (e.g., a text box), while dataset-type controls replace multi-record views like grids or galleries, receiving a full dataset with multiple rows and columns.
What should a developer implement in the `destroy` method of a PCF control?
Answer: Cleanup of event listeners, timers, and external subscriptions to prevent memory leaks
The `destroy` method is called when the control is removed from the UI and is the correct place to teardown event listeners, cancel pending async operations, and free any external resources.
Which workflow correctly packages and deploys a PCF control to a Dataverse environment for production use?
Answer: Build the solution with `pac solution build` to create an importable .zip, then import it via the Maker Portal or pac solution import
For production, `pac solution build` (or `msbuild`) creates a solution .zip that is imported like any other Dataverse solution; `pac pcf push` is a faster shortcut only appropriate for development environments.