How to Patch a Collection in Power Apps [Single/Multiple Items]

When you build a real Power Apps Canvas app for vendor management, people usually want to make several small changes at once rather than edit one record at a time. They might scan a list of vendors, adjust a few quantities or dates across the grid, and then save everything together when they are ready.

Let’s say a purchasing officer can load this month’s vendors into a collection, update values directly in the gallery, and even add new vendors while all the changes stay safely in memory. With a single click on Save all changes, one Power Apps Patch operation sends the updated records from the collection back to the SharePoint list or other data source in bulk.

In this tutorial, we’ll walk through practical ways to patch a collection in Power Apps, with simple examples and real‑world tips you can use in your apps.

1. Patch a Single Record into a Power Apps Collection

Let’s start with a simple example: you already have a Power Apps Collection of books and want to add a new book record.

Assume you created this Power Apps collection on a button’s OnSelect:

ClearCollect(
colBook,
Table(
{ Name: "Geetanjali", Author: "Rabindra Nath Tagore", Sale: 200 },
{ Name: "Wings of Fire", Author: "A. P. J. Abdul Kalam", Sale: 350 }
)
);

To patch a new book into this collection using another button:

OnSelect =
Patch(
colBook,
Defaults(colBook),
{
Name: "Mind F**ked",
Author: "Anubhav Agrawal",
Sale: 280
}
)

Here’s what is happening:

  • colBook is the target collection.
  • Defaults(colBook) tells Power Apps you want to create a new record in that collection.
  • The record { } defines the values for the new record.
Power Apps patch collection record

That’s it! We can see that a new record will be added to the Power Apps collection when the button is clicked.

Power Apps patch collection create item

2. Update a Record in a Power Apps Collection Using LookUp

Very often, you don’t want to add a new record; you want to modify an existing one.

For example, you want to change the author name of the book “Geetanjali” from “Rabindra Nath Tagore” to “R.N.Tagore”.

Power Apps Patch collection with lookup

You can do this with Power Apps Patch + LookUp:

OnSelect =
Patch(
colBook,
LookUp(colBook, Name = "Geetanjali"),
{ Author: "R.N.Tagore" }
)

What’s going on:

  • LookUp(colBook, Name = "Geetanjali") Returns the record you want to update.
  • Patch updates only the Author field, keeping all other fields as they are.
PowerApps Patch collection with lookup

Once the Patch button is clicked, we can see that the specified author name will be updated as shown below:

Power Apps Patch update collection

Tip: When your collection has an ID or GUID field, it’s better to LookUp by that instead of a text field like Name, to avoid accidental matches.

3. Patch Multiple Records From a Power Apps Collection to SharePoint

A very common pattern is:

  1. Load data into a Power Apps collection.
  2. Let the user modify data in the app.
  3. Patch all the changes back to SharePoint in one go.

Assume you have a SharePoint list called Vendors List with columns: ID, Title, Order Date, Quantity.

Power Apps Patch collection multiple records

First, you build a collection with multiple records:

OnSelect =
ClearCollect(
ColVendors,
Table(
{ Title: "Aerotek", OrderDate: Date(2022,10,18), Quantity: 180 },
{ Title: "PrideStaff", OrderDate: Date(2022,11,11), Quantity: 135 },
{ Title: "Flexicrew", OrderDate: Date(2022,12,14), Quantity: 105 }
)
);

Then, you patch these records to the SharePoint list:

Patch(
'Vendors List',
ForAll(
Sequence(CountRows(ColVendors)),
Defaults('Vendors List')
),
ColVendors
)
Power Apps forall patch collection SharePoint list

When you check the specified SharePoint list, you’ll see the newly added records as shown below:

Power Apps collection patch all

This pattern:

  • Creates the same number of default records in the list as the number of items in ColVendors.
  • Uses the values from ColVendors to populate the SharePoint rows.
  • Lets you push multiple records from a collection into a data source in one go, which is much more efficient than patching row by row.

4. Refresh a Power Apps Collection after Patch (and keep the UI in sync)

Sometimes you patch to the data source and also maintain a local collection for the Power Apps gallery.

A common pattern is:

  • The gallery shows a collection, say ColVendorList.
  • User selects an item and edits it via a form connected to SharePoint.
  • When you submit the form, you also update the collection, which refreshes the gallery immediately.

Your edit form might be bound like this:

Item = ColVendorList_Gal.Selected
Power Apps Patch collection from form

On the Save or Patch button:

OnSelect =
SubmitForm(VendorsList_Form);
Patch(
ColVendorList,
ColVendorList_Gal.Selected,
{
'Order Date': VendorsList_Form.LastSubmit.'Order Date',
Quantity: VendorsList_Form.LastSubmit.Quantity
}
);

What this does:

  • SubmitForm saves changes to the SharePoint list.
  • VendorsList_Form.LastSubmit gives you the record that was just saved.
  • Patch updates the matching record in ColVendorList, so the gallery shows the new values immediately without needing to re‑collect the whole list.
Power Apps collection refresh after patch

That’s it! Let’s select the second item from the Power Apps gallery (i.e., Gilli). Modify the date to 12/25/2022 and the quantity to 210. When we click on the Patch button, the specified item will be modified only in the Power Apps collection.

PowerApps Patch collection from form

5. Power Apps Patch a Collection dynamically From User Inputs

Another powerful use case is building collections dynamically from Power Apps controls like Text Input, Date Picker, and Dropdown.

Suppose you have a collection ColEmployee with columns: Name, JoinDate, Department.

On OnVisible of the screen, you might initialize it:

ClearCollect(
ColEmployee,
Table(
{ Name: "John", JoinDate: Date(2023,1,10), Department: "IT" }
)
);

On the screen, add:

  • A Power Apps Text Input: Name_Txt
  • A Power Apps Date Picker: JoinDate_DatePicker
  • A Power Apps Dropdown: Department_DD

Set dropdown Items:

Items = ["IT", "Finance", "Management"]

Now patch new records dynamically:

OnSelect =
Patch(
ColEmployee,
Defaults(ColEmployee),
{
Name: Name_Txt.Text,
JoinDate: JoinDate_DatePicker.SelectedDate,
Department: Department_DD.Selected.Value
}
)
PowerApps Patch collection dynamically

This lets your users add new employees on the fly and see them instantly in a gallery bound to ColEmployee.

That’s all! Let’s preview the app and fill in the controls by inserting desired data. And click on the Patch button. We can see that the item was patched in the Power Apps collection and displayed in the above-mentioned gallery.

Patch Power Apps collection dynamically

6. Patch a Power Apps Collection Back to Excel

You can also patch from a Power Apps collection into an Excel table that is connected as a data source.

Say you have an Excel table ProductsTable with columns Product, Availability, Quantity, and you loaded it into a collection ColProducts.

Power Apps collection patch to excel
PowerApps collection patch to excel

You want to modify the Excel row where Product = “Mobile” to set:

  • Product = “Tablet”
  • Quantity = 26
  • Only if Availability = "Yes" for that record.

You can do:

OnSelect =
ForAll(
Filter(ColProducts, Availablity = "Yes"),
Patch(
ProductsTable,
LookUp(ProductsTable, Product = "Mobile"),
{ Product: "Tablet", Quantity: 26 }
)
)
PowerApps collection patch modify item to excel

Once we click on the Power Apps button, the item will be modified in the Excel table as shown below:

Power Apps collection patch to excel sheet

This approach:

  • Filters the collection in memory (fast) and then patches only those records that meet the condition.
  • Keeps the logic in Power Apps while the final update happens in Excel.

7. How to Use Power Apps Patch to “Delete” or Hide Items From a Collection

Sometimes you don’t want to truly delete a record from the datasource, like a SharePoint list, Excel, etc. Instead, you set a flag and hide it in the UI.

Imagine a SharePoint list Product Model with a Yes/No column, Delivered.

Power Apps Patch delete collection

You created a collection ColProductModel from this list and show it in a gallery with a checkbox bound to the Delivered column.

PowerApps Patch delete collection

On the Power Apps Checkbox OnUncheck property:

Patch(
ColProductModel,
ThisItem,
{ Delivered: false }
);
Notify("Item deleted", NotificationType.Success);
Power Apps Patch remove collection

Then, on the gallery Items property, you show only “active” items:

Filter(ColProductModel, Delivered = true)
Power Apps Patch delete collection item

That’s it! Let’s preview the app and uncheck an item within the gallery (for example, iPhone 12 Pro Max). Once we uncheck the item’s check box, it will remove that item from the gallery and notify the user as shown below:

PowerApps Patch delete collection item

8. Patch Yes/No columns From Power Apps Radio Control

For Yes/No columns coming from SharePoint, you might want to use a Power Apps Radio control (Yes / No) instead of a checkbox.

Assume:

  • Collection: collProduct
  • Boolean column: Delivered
  • Gallery: Gallery1
  • Radio: Radio2 with Items = ["Yes","No"]
PowerApps Patch collection yes no column SharePoint

On Radio OnChange:

Patch(
collProduct,
LookUp(collProduct, ID = Gallery1.Selected.ID),
{
Delivered:
If(
Radio2.Selected.Value = "No", false,
Radio2.Selected.Value = "Yes", true
)
}
)
Patch Power Apps collection yes no column SharePoint

This pattern:

  • Uses the ID to find the correct record in the collection.
  • Maps text values “Yes/No” to true/false.
  • Keeps the collection and the gallery in sync with the user’s selection.

That’s all. Let’s change the options for a few items (Ex- 5 items from the first).

How to patch Power Apps collection yes no column SharePoint

We can see those that will be changed in the Power Apps collection below:

How to patch Power Apps collection using SharePoint yes no column

9. Power Apps Patch Choice Columns From Dropdown

For SharePoint choice columns, you usually patch the whole choice record, not just the .Value.

Assume:

  • Collection: collProduct
  • Choice column: Manufacturer (SharePoint choice)
  • Gallery: Product Gallery
  • Dropdown: Manufacturer_DD with Items = Choices('Product Model'.Manufacturer)
Power Apps Patch collection from dropdown

Set the Default property of the dropdown:

'Product Gallery'.Selected.Manufacturer.Value
PowerApps Patch collection from dropdown

On dropdown OnChange patch back to the collection:

Patch(
collProduct,
LookUp(
collProduct,
Title = 'Product Gallery'.Selected.Title
),
{ Manufacturer: Manufacturer_DD.Selected }
)
Power Apps Patch collection SharePoint choice field

Key point:

  • For choice columns, you usually assign Manufacturer_DD.Selected (the whole record) instead of Manufacturer_DD.Selected.Value.

10. Power Apps Patch One Collection Into Another Collection

Sometimes you need to keep two collections in sync or map values from one to another.

Say you have:

  • Collection1 with columns: ProductNo, ProductGUID
  • Collection2 with columns: ProductSeq, Vendor, ProductID

You want: if ProductNo = ProductSeq, then update ProductID in Collection2 with ProductGUID from Collection1.

Power Apps Patch collection to another collection

You can do:

OnSelect =
ForAll(
Collection1,
UpdateIf(
Collection2,
ProductSeq = ProductNo,
{ ProductID: ProductGUID }
)
)
PowerApps Patch collection to another collection

This is a neat pattern for:

  • Joining data between collections.
  • Performing mass updates where you match on a key field like ProductNo.

Once the patch button is clicked, we can see the ProductGUID will be updated in the ProdductID.

Patch collection to another collection in Power Apps

Best Practices When Patching Power Apps Collections

Here are some practical tips that will help you avoid common issues.

Use IDs or GUIDs for matching

When updating existing records with Patch, prefer using ID or GUID fields rather than text fields such as Name or Title.

Example:

Patch(
ColEmployees,
LookUp(ColEmployees, ID = varSelectedID),
{ Department: "Finance" }
)

This reduces the risk of updating the wrong record when names are duplicated.

Watch delegation and record limits

Collections themselves are not delegated, but functions you use to load data into them might be.

  • SharePoint, SQL, Dataverse, etc., often have delegation limits (500–2000 records by default).
  • When you use non‑delegable operations in your ClearCollect, you might only get the first 500 (or 2000) records.

If you work with large data sets, try to:

  • Use delegable filters where possible when building the collection.
  • Use ID‑based paging or chunking patterns when importing big data into a collection.

Handle Patch errors

The Power Apps Patch command does not guarantee success every time.

There can be:

  • Validation errors in SharePoint / Dataverse
  • Permission issues
  • Network problems

You can capture errors using the Errors function or IfError (with formula‑level error management turned on).

Example pattern:

UpdateContext(
{
varPatchedRecord: Patch(
'Vendors List',
Defaults('Vendors List'),
{ Title: "Test", Quantity: 10 }
)
}
);

If(
!IsEmpty(Errors('Vendors List')),
Notify(
Concat(
Errors('Vendors List'),
Message,
" "
),
NotificationType.Error
),
Notify("Saved successfully", NotificationType.Success)
);

This way, you don’t silently fail when a patch doesn’t go through.

If you build your apps with these patterns in mind, you will find it much easier to manage complex screens, multi‑step edits, and bulk updates in a clean and maintainable way.

Also, you may like some more Power Apps tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…