Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

Power Apps EditForm Function (6 Practical Examples)

If you have a record open read-only in Power Apps and you want fields the user can change, the EditForm function is the quickest way to get it. It takes the form control and flips it into edit mode, so the fields turn into boxes the user can type in.

It doesn’t save anything. Saving is still the job of SubmitForm.

In this tutorial, I’ll show you how to use the power apps editform function with an Edit button, gallery rows, pencil icons, DisplayMode rules, a Save button and a locked-record check, all tested in a real canvas app.

Power Apps EditForm Function Syntax

EditForm takes a single argument:

EditForm( FormName )
ParameterRequiredTypeDescription
FormNameYesEdit form controlThe form to switch to FormMode.Edit. Pass the control name, such as frmEf.

Return value: none. EditForm only changes the form’s Mode property. The record shown still comes from the form’s Item property, and SubmitForm saves the changes later as an update, not a new item.

The mode also sets the form’s DisplayMode, which every data card inherits:

ModeDisplayModeWhat the user sees
FormMode.EditDisplayMode.EditExisting record, editable fields
FormMode.NewDisplayMode.EditDefault values, editable fields
FormMode.ViewDisplayMode.ViewExisting record, read-only

In a canvas app, EditForm works only in behavior properties such as OnSelect. It reads no data, so delegation doesn’t apply. Edit is also the form’s default mode, so you’ll mostly call it after ViewForm or NewForm.

When to Use the EditForm Function in Power Apps

  • An Edit button on a details screen that opens records read-only.
  • A form next to a gallery, so the gallery’s OnSelect property opens the picked row.
  • A pencil icon on each gallery row.
  • Enabling Save only while the form is editable.
  • Blocking edits on records that should stay locked.
  • Editing rows in a SharePoint list or a Dataverse table, since EditForm works the same with either data source.

Example 1: Switch a View Form to Edit With a Button

My Power Apps demo screen scrFnEditForm has an Edit form named frmEf on my SharePoint list IT Help Requests. I set its DefaultMode to FormMode.View, so it opens read-only.

Here’s how to add a formula. Select the Edit button, pick OnSelect in the property dropdown left of fx, and type in the formula bar. Then press Play, or hold Alt and click the button.

EditForm(frmEf)
EditForm formula in the OnSelect property of a modern button in Power Apps Studio

To see the mode, I added a text label with this Text formula:

"Form mode: " & Switch(
    frmEf.Mode,
    FormMode.Edit, "Edit",
    FormMode.New, "New",
    FormMode.View, "View"
)
Preview before the click with the form mode label showing View
Preview after clicking Edit with the form mode label showing Edit

How does this work?

Before the click, the label read “Form mode: View” and the fields showed plain values. After it, the label read “Form mode: Edit”, Title got its red required star, and every field became editable.

Example 2: Edit the Item Selected in a Power Apps Gallery

Next, I added four throwaway rows to IT Help Requests and showed them in a gallery named galEf:

TitleCategoryAssetTag
Demo EditForm – Laptop battery swapHardwareLT-20417
Demo EditForm – VPN drops every hourNetwork
Demo EditForm – Shared mailbox accessAccess
Demo EditForm – Excel add-in crashSoftware

The form’s Item property points at the selected row:

galEf.Selected

The gallery’s OnSelect switches the form to edit mode:

EditForm(frmEf)
Gallery OnSelect property set to EditForm in Power Apps Studio
Preview with the VPN request picked in the gallery and the form in edit mode

How does this work?

Clicking “Demo EditForm – VPN drops every hour” did two things. galEf.Selected changed, so the form loaded that row, and EditForm made it editable. The empty AssetTag box showed its “Enter text” hint.

When the screen first opens, a Power Apps gallery selects its first row by default, so the form already shows a record before anyone clicks. You can change that with the gallery’s Default property.

Pro Tip: Item decides which record, EditForm decides how. Keep them in separate properties. Showing a form for the gallery’s selected item covers the Item side in more depth.

Example 3: Add an Edit Icon to Each Gallery Row

Users often just want to read a row. So I changed the gallery’s OnSelect to open rows read-only:

ViewForm(frmEf)

Then I turned the row’s arrow icon into a pencil (Icon.Edit) and gave it this OnSelect:

EditForm(frmEf)
Pencil icon inside the gallery template with EditForm in its OnSelect property
Preview after clicking the pencil icon on a gallery row with the form in edit mode

How does this work?

A click on the Laptop row text ran ViewForm, and the label showed “View”. A click on the pencil of “Excel add-in crash” selected that row and ran EditForm, so the label showed “Edit”.

Pro Tip: The arrow’s default OnSelect is Select(Parent). I first tried Select(Parent); EditForm(frmEf), and the form ended in View mode. Select made Power Apps run the gallery’s ViewForm after EditForm, so drop it.

Example 4: Tie DisplayMode to the Form Mode in Power Apps

An Edit button makes no sense while the form is already editable, and Save makes no sense in view mode. The Edit button’s DisplayMode handles the first part:

If(
    frmEf.Mode = FormMode.View,
    DisplayMode.Edit,
    DisplayMode.Disabled
)
DisplayMode formula on the Edit button that disables it in edit mode

The Save button’s Visible property handles the second:

frmEf.Mode = FormMode.Edit

I also put a note box outside the form and gave it DisplayMode = frmEf.DisplayMode, the same idea every data card uses as Parent.DisplayMode:

frmEf.DisplayMode
Data card DisplayMode set to Parent.DisplayMode in the formula bar
Preview in edit mode with the Edit button disabled and the Save button visible
Preview in view mode with the Save button hidden and the note box read-only

How does this work?

In edit mode, Edit grayed out, Save appeared, and the note box accepted “Call back after 3 PM ET”. After ViewForm, Edit came back, Save disappeared, and the note turned read-only but kept its text. See how to disable a button in Power Apps for more DisplayMode patterns.

Example 5: Save Changes and Go Back to View Mode

EditForm opens the record, and SubmitForm writes it back. My Save button’s OnSelect:

SubmitForm(frmEf)

The form’s OnSuccess property confirms the save and locks the form again:

Notify(
    "Saved: " & frmEf.LastSubmit.Title,
    NotificationType.Success
);
ViewForm(frmEf)

I opened “Demo EditForm – Laptop battery swap” with its pencil, changed AssetTag from LT-20417 to LT-20488, and clicked Save.

Green Saved banner and the form back in view mode after SubmitForm

How does this work?

Because the form was in edit mode, SubmitForm updated the existing item, and the gallery still had four rows. OnSuccess showed “Saved: Demo EditForm – Laptop battery swap” and the label went back to “View”. The LastSubmit property held the saved record, and the Notify function showed the green banner.

Then I cleared the Title on another row and clicked Save. Title is required, so nothing was saved:

Red required-field banner and Title is required message after a failed save

Power Apps showed “An entry is required or has an invalid value. Field(s) with problems: ‘Title’.” The card said “Title is required.” and the form stayed in edit mode.

A successful save is a normal SharePoint update, so a Power Automate flow with the “When an item is created or modified” trigger runs for it too.

Example 6: Block Editing for Locked Records

Some rows shouldn’t be changed in Power Apps at all. In my list, Access requests go through IT, so I upgraded the pencil icon’s OnSelect with an If statement:

If(
    ThisItem.Category.Value = "Access",
    Notify(
        "Access requests are locked. Ask the IT team to change them.",
        NotificationType.Warning
    ),
    EditForm(frmEf)
)
If formula on the pencil icon that blocks EditForm for Access requests
Warning banner in Preview when the pencil is clicked on an Access request

How does this work?

On “Demo EditForm – Shared mailbox access”, the condition was true. The yellow banner appeared and the form stayed in view mode. On the Hardware row, EditForm ran and the label showed “Edit”.

Pro Tip: Hide the icon instead with Visible = ThisItem.Category.Value <> "Access". Either way, it’s only a UI rule. Real protection belongs in SharePoint permissions.

Common Mistakes with the Power Apps EditForm Function

  • Wrong property. EditForm(frmEf) in a label’s Text shows “Behavior function in a non-behavior property.” Use OnSelect.
  • Wrong control. EditForm(galEf) shows “The function expects an editable form as its input.”
  • It doesn’t save. Nothing reaches SharePoint until SubmitForm runs and form validation passes.
  • ViewForm drops typed text. I typed VPN-TEST, clicked my ViewForm Cancel button, then Edit again. The box was empty.
  • Blank Item. A blank Item in edit mode makes the cards show default values. Make sure a row is selected.

Wrapping Up

The Power Apps EditForm function takes one argument, returns nothing and switches a form to edit mode. Pair it with Item for the record, DisplayMode for the buttons and SubmitForm for the save.

Browse all Power Apps functions, or read the EditForm and form functions on Microsoft Learn.

Other Power Apps functions you may find useful: