All posts
TricksDecember 11, 2025· 2 min read
The Patch Function Trick That Saves Hours in Power Apps
J
Juan Carlos Santiago
The Patch Function Trick That Saves Hours in Power Apps
If you are using ForAll with Patch to update multiple records, you are doing it the slow way. There is a much faster approach.
The Slow Way
ForAll(
colModifiedRecords,
Patch(Products, LookUp(Products, ID = Value), ThisRecord)
)
This sends one API call per record. 100 records = 100 calls = slow and throttled.
The Fast Way
Patch() accepts a table as its second argument:
Patch(Products, colModifiedRecords)
That is it. One single call. Power Apps batches everything into one request to the data source.
Requirements
- Each record in your collection must have the primary key (ID column) so Power Apps knows which record to update
- The column names must match the data source exactly
- Works with Dataverse, SharePoint, and SQL Server
When to Use This
- Bulk status updates: Mark 50 items as "Completed" in one shot
- Data imports: Push a parsed CSV into your data source
- Offline sync: Sync all locally modified records at once
Performance Comparison
| Method | 100 Records | 500 Records |
|---|---|---|
| ForAll + Patch | ~30 sec | ~2.5 min |
| Single Patch | ~2 sec | ~5 sec |
Pro Tip
Combine this with Collect to track changes. Use a hidden collection to store modified records, then patch them all at once when the user clicks Save:
// On change:
Collect(colChanges, {ID: ThisItem.ID, Status: "Done"})
// On save button:
Patch(Products, colChanges);
Clear(colChanges);
Notify("All changes saved!")
This pattern is recommended by Microsoft for high-performance Canvas Apps.
#power-apps#patch#performance#bulk-update#collections
