# How should a PCF control handle host updates, user edits and cleanup?

Exam: AB-400 — Power Platform Developer Associate
Knowledge domain: Extend the user experience (25–30%)
Updated: 2026-11-25T06:47:18.788473+00:00
HTML: https://learningpathx.com/faq/AB-400/ab400-pcf-lifecycle-bound-value-and-save.html

## Also asked as

- What do init, updateView, notifyOutputChanged, getOutputs, and destroy do in a PCF field control?
- How do I send a validated PCF field edit without creating a second Dataverse save path?

Receive host state through `updateView`, emit a valid user edit through `notifyOutputChanged` and `getOutputs`, and let the host save the bound value. Keep control creation and cleanup in the lifecycle methods.

In a standard field control, `init` creates owned elements, registers handlers once and stores the output callback. Request resize tracking there if needed. `updateView` receives the latest properties, layout and disabled state. Reconcile display without emitting changes on render. Keep empty or not-yet-loaded values distinct from zero and define how a host update affects an in-progress edit.

On a valid changed commit, store the output, call `notifyOutputChanged` and return the value under the manifest property name from `getOutputs`. Show invalid-input feedback without emitting a replacement. Keep saves in the host flow to avoid racing a second API write. In `destroy`, remove listeners, timers, observers and rendering resources, and ignore async completions that arrive after disposal.

Test a null value, a valid zero, an invalid entry, a disabled control and repeated resizes. Save a valid edit through the app, reopen the row and check persistence. For a whole-number range, include blank text, a fraction and out-of-range values. Decide separately whether clearing is supported. Repeat with keyboard interaction, narrow layout and accessible labels.

[StandardControl lifecycle](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/reference/control) · [Implement a code component in TypeScript](https://learn.microsoft.com/en-us/power-apps/developer/component-framework/implementing-controls-using-typescript)

Source: [AB-400: Building Reusable PCF Code Components](https://learningpathx.com/news/ab-400-building-reusable-pcf-code-components.html)
