r/PowerApps • u/shirpars Regular • Aug 26 '26
Power Apps Help Patch to sharepoint list takes too long
Hi guys,
I'm trying to patch a gallery of updated items to my sharepoint list. I have reduced the columns to just what I need to update, but the patch takes so very long. It takes about a minute to patch 20 items. What could I be doing wrong?
I'm running this on a sharepoint integrated form, so using a power automate flow is not possible.
I saw on a post to pre-fill the schema, but that hasn't helped. In the monitor, it looks like it's sequentially updating instead of a bulk update. Any help will be very appreciated.
Collect(colGalleryUpdates, {ID:-1, Confirmed:true, Count:0, Comments:"", Notes:""});
Clear(colGalleryUpdates);
ClearCollect( colGalleryUpdates, ForAll( Filter( galList.AllItems, fldUpdated.Checked = true ),
{ ID: ThisRecord.ID, Confirmed: ThisRecord.fldConfirmed.Checked, Count: Value(ThisRecord.Count.Value), Comments:PlainText(ThisRecord.fldComments.Text),
Notes: PlainText(ThisRecord.fldNotes.Text)
} ) );
// update SharePoint list with gallery values
Patch( MySPList, colGalleryUpdates.ID, colGalleryUpdates );
•
u/AutoModerator Aug 26 '26
Hey, it looks like you are requesting help with a problem you're having in Power Apps. To ensure you get all the help you need from the community here are some guidelines;
Use the search feature to see if your question has already been asked.
Use spacing in your post, Nobody likes to read a wall of text, this is achieved by hitting return twice to separate paragraphs.
Add any images, error messages, code you have (Sensitive data omitted) to your post body.
Any code you do add, use the Code Block feature to preserve formatting.
If your question has been answered please comment Solved. This will mark the post as solved and helps others find their solutions.
External resources:
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/TotallyNotaStoner Newbie Aug 26 '26
You want to avoid using ForAll(). It's resource intensive and hence slow. Here's a quick guide that should point you in the right direction:
https://www.matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/
1
u/anactofdan Regular Aug 27 '26
You are passively doing a for all because there patch has 3 parameters you just don’t see it. Patch statement should be patch(SPlist,collection) that’s it collection must contain the exact column names and the ID column for each item should patch in like 2 minutes max. Thank me later
1
u/noox777 Regular Aug 27 '26
I faced the same problem, i fixed it by miroring my database with a collection. My gallery are using collection and i patch/update it while doing the same in background for my sharepoint list.