Tutorials/Power Apps/Mastering Power Apps Form Modes: Create, Edit, and View Records Seamlessly
Power Appsintermediate

Mastering Power Apps Form Modes: Create, Edit, and View Records Seamlessly

Learn how to use a single form in Power Apps to switch between adding, modifying, and displaying records using NewForm, EditForm, ViewForm, and ResetForm.

NA
Narmer Abader
@narmer · Published June 3, 2026

In Power Apps, a single form control can serve three distinct purposes: creating a new record, editing an existing record, or displaying a record as read-only. The form's behavior is controlled by its Mode property, which you change by calling the functions NewForm, EditForm, ViewForm, and ResetForm. This article shows you how to implement these modes using a practical example, so you can build apps that let users add, update, and inspect data without requiring multiple screens or forms.

Example Scenario: IT Equipment Checkout

Imagine an IT department that needs to track which employees have checked out equipment. The app will allow a technician to:

  • Log a new equipment checkout.
  • Update an existing checkout record (e.g., mark equipment as returned).
  • View the details of a checkout without accidentally editing it.

We'll use a SharePoint list as our data source.

SharePoint List Setup

Create a new SharePoint list named EquipmentCheckout and add these columns:

Column NameTypeDetails
EquipmentNameSingle line of texte.g., "Laptop - Dell XPS"
CheckedOutToSingle line of textEmployee name
CheckoutDateDate and TimeDate only
ReturnStatusChoiceChoices: Returned, Not Returned

Populate a few sample rows:

EquipmentNameCheckedOutToCheckoutDateReturnStatus
Dell MonitorAlice Chen2026-05-10Returned
MacBook ProBob Ray2026-05-12Not Returned
iPad AirCarol Smith2026-05-15Not Returned
USB-C HubDavid Lee2026-05-18Returned

Building the App

Open Power Apps Studio, create a new blank canvas app, and connect it to your EquipmentCheckout list.

Screen 1: Form Screen

Add a new screen called CheckoutFormScreen. Insert a form control and name it frm_Checkout. Set its DataSource to EquipmentCheckout. Configure the form's fields to show EquipmentName, CheckedOutTo, CheckoutDate, and ReturnStatus. Remove any unwanted fields such as Title or Attachments.

Add a Submit button below the form and set its OnSelect to:

powerfxSubmit form
SubmitForm(frm_Checkout)

Create another screen named GalleryScreen. Insert a gallery and connect it to the EquipmentCheckout data source. Choose a layout that shows the equipment name and status. Set the gallery’s fields:

  • TitleEquipmentName
  • SubtitleCheckedOutTo
  • BodyReturnStatus

Add an Add icon (or button) in the screen’s title bar to create new records. We'll wire it up later.

Viewing a Record (ViewForm)

When a user selects an equipment record in the gallery, the app should open the form screen in read‑only mode. This prevents accidental changes.

Set the gallery's OnSelect to:

powerfxGallery OnSelect – view mode
Set(varSelectedEquipment, ThisItem);
ViewForm(frm_Checkout);
Navigate(CheckoutFormScreen)

On the form screen, set the form's Item property to the variable:

powerfxForm Item property
varSelectedEquipment

Now, when you preview the app and tap a gallery item, the form shows the record’s details but all fields are read‑only. The Submit button should be hidden while the form is in view mode. Set the button’s Visible property:

powerfxHide Submit button in view mode
frm_Checkout.Mode <> FormMode.View

Editing a Record (EditForm)

To allow editing, place an Edit icon on the form screen’s title bar. Set its OnSelect to:

powerfxEdit icon OnSelect
EditForm(frm_Checkout)

When the user clicks Edit, the form switches to edit mode, fields become editable, and the Submit button reappears.

Handling Save Success and Failure

Define what happens after the form is submitted. In the form’s OnSuccess property, update the variable to reflect the latest submission, return to view mode, and show a success notification:

powerfxForm OnSuccess
Set(varSelectedEquipment, frm_Checkout.LastSubmit);
ViewForm(frm_Checkout);
Notify("Equipment record saved successfully.", NotificationType.Success)

For error handling, set the form’s OnFailure property:

powerfxForm OnFailure
Notify("Error: Could not save the record.", NotificationType.Error)

When the user taps the Submit button, the form saves the changes and then returns to view mode.

Adding a New Record (NewForm)

To create a new checkout record, use the Add icon on the gallery screen. Set its OnSelect to:

powerfxAdd icon OnSelect
Set(varSelectedEquipment, Blank());
NewForm(frm_Checkout);
Navigate(CheckoutFormScreen)

When navigating to the form screen, the form shows empty fields ready for input. The Edit icon should be hidden while in new mode because there is no existing record to edit. Set its Visible property:

powerfxHide Edit icon when not in view mode
frm_Checkout.Mode = FormMode.View

After the user fills in the fields and submits, the record is saved. The OnSuccess handler can be reused—it will automatically switch back to view mode (in this case showing the newly created record).

Resetting the Form on Navigation

When the user leaves the form screen, the form should be reset to clear any leftover data. Add a Back arrow or button to the form screen and set its OnSelect:

powerfxBack button OnSelect
ResetForm(frm_Checkout);
Navigate(GalleryScreen)

Without ResetForm, the form would still show the previous record’s data when another item is selected from the gallery.

Common Mistakes and Troubleshooting

  • Forgetting to set the form’s Item property. If the form doesn't show data after ViewForm, check that the Item property points to the correct variable or record.
  • Not resetting the form when navigating back. This results in stale data appearing on the next view.
  • Incorrect button visibility logic. Use frm_Checkout.Mode <> FormMode.View for submit (hide in view) and frm_Checkout.Mode = FormMode.View for edit (show only in view). Double‑check the operator.
  • Delegation warnings. When your SharePoint list grows, functions like ViewForm and EditForm operate on a single record, so delegation is not an issue. However, gallery data source may hit delegation limits for filtered queries; consider using Search or Filter with delegation‑friendly operators.

Best Practices

  • Use descriptive variable names (e.g., varSelectedRecord) to avoid confusion.
  • Keep form OnSuccess logic consistent across both Edit and New modes.
  • Use the FormMode.View and FormMode.Edit and FormMode.New enum values instead of magic numbers.
  • Always call ResetForm before leaving the form screen to ensure a clean slate.

Conclusion

By mastering NewForm, EditForm, ViewForm, and ResetForm, you make your Power Apps more efficient and user‑friendly. A single form can serve multiple states — creation, editing, and read‑only display — reducing the need for duplicate screens and improving maintainability. Apply the pattern shown here to your own apps and adapt it to your business logic.

References