Announcements
Hi everyone,
I’m having an issue in a Power Apps app where multiple users edit and save the same SharePoint records at the same time. Data entered by one user sometimes gets overwritten and lost when another user saves.
I implemented this so far: I am comparing the currently opened record with the latest version from SharePoint before calling Patch()
Patch()
The problem is that refreshing the record removes all unsaved changes of the current user.
Therefore I thought of tracking the changes via OnChange variables and patch only modified fields, but this feels very complex (many fields, forms, attachments, people fields, etc.).
OnChange
A locking mechanism is not desired by users.
Question: Is there a recommended best-practice approach in Power Apps to handle concurrent edits and prevent overwriting other users’ changes when using SharePoint?
Thanks!
If( ThisItem.Modified <> Lookup( SPList, ID = ThisItem.ID ).Modified, UpdateContext( { varSavedRecord: { Field1Name: Control1.Output, Field2Name: Control1.Output, . . . . . . . . } } ), Refresh(SPList); Notify( "Please save again as the record has been modified since you opened it", NotificationType.Information ), Patch( SPList, YourPatchHere ); UpdateContext({varSavedRecord: Blank()}) )
Coalesce( varSavedRecord.FieldName, ThisItem.FieldName )
UpdateContext({varSavedRecord: Blank()})
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 424
WarrenBelz 355 Most Valuable Professional
11manish 290