web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Lock item when someone...
Power Apps
Unanswered

Lock item when someone is editing

(0) ShareShare
ReportReport
Posted on by 101

I'm trying to figure out a way to stop two people from being on the same Edit Form at the same time.  So I have a gallery and when you click on the arrow it takes you to another screen where you can edit information about that specific item.  The issue is we can have multiple people in the app at the same time but we don't want two people to be doing the same request at the same time.  I would like for the app to disable the submit button and have a label show up that says "This item is locked by <user email>.".  

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @MattyJ_09,

     

    The apps made in PowerApps are multiuser. They each are their own instances so it does not matter how many users use it at the same time. If multiple users edit the same record at the same time, only single one user could edit the record, the other users would face conflict error within their app.

     

    More details about the errors type within the app when submitting the form, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-errors#description

     

    Regards,

    Mona

     

    Currently, you could re-edit the same record only when the other user saved his/her modification into the SP list.

  • Verified answer
    cwebb365 Profile Picture
    3,294 Most Valuable Professional on at
    If the built in error checking isn’t enough. You can always have the app add a lockedby value in a column you add to a database somewhere. This will require an online connection and a database call however.

    Then when you form loads you check for a value in that column if it doesn’t exist then you lock it with the current user and patch that change to the dB. If there is a lock you display error with the locked by column value to the user and disable the button.

    Now you also need to build in some kind of release for locks as well in case someone doesn’t save a value or quits the app or it crashes. So similar to how SharePoint does it runs an unlock process every five or ten minutes looking for locked records and remove the locks.

    Or you could also give the user the ability to remove a lock if it’s locked but that could cause issues. Or maybe only give them the option when a record has been locked for more than 10 minutes.

    That said you would need to also have a lockedon column with how long the column has been locked for so you can do the 10 minute user option or 10 minute auto clean out. But maybe records could be open longer then 10 minutes you would need to adjust.


    Anyway just a couple ideas of how you could quickly handle or add some lock logic into your app.
  • MattyJ_09 Profile Picture
    101 on at

    I was able to get something very similar to this worked out.  When they press the button to go into the edit form screen I have a patch happen that sends the logged in users email address to the database.  Then once they are on the screen I have the submit button disappear and an unlock button appear based on the value in the database.  I did bring in a gallery (that filters only the data that was clicked into) and a timer that refreshes the gallery every ten seconds.  So if someone goes into the app and unlocks the edit form for the particular entry then the other persons page shows the lock button.  I'm sure I may have been able to find a better solution but for what we need it for it will work. 

  • Motleyts Profile Picture
    14 on at

    Circling back to this, what steps did you take to achieve this?

  • lcordov Profile Picture
    47 on at

    We're you able to find a solution?

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard