cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CSilva
Advocate I
Advocate I

Create Currently In Use by Another User Function

In my application I have a gallery of tasks that need to be completed by multiple users. Each user is to select a task, then complete it using the application. There is an issue though when multiple users select the same task.

 

To prevent this, when a task is selected, it patches the document library where the tasks are stored with the user's name and an "in progress" boolean value to true. Validations are then put in place to ensure that another user cannot select the same task if it is marked as "in progress" and the user name does not match. 

 

Despite this, it is still possible for two users to select one at the same time if the second user's data source has not refreshed after the first user selected the task. In order to solve this issue, on the task selector button, it refreshes the data source, then triggers validations, then patches the data source with the user's name and the "in progress" boolean. I thought this solved the issue, but for some reason, if the button refreshes the data source first, it will occasionally patch the wrong task in the gallery. 

 

For example, a user will select Task 1. It will refresh the data source, validate whether it is in progress or not, then patch task 3 with the user's info and "in progress" status. I have no idea why this happens but could use some assistance with the issue of preventing multiple users from selecting the same task at the same time. 

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @CSilva ,

This is a common issue with a number of not perfect workarounds (as you have discovered). I have a "blunt force" approach and it depends how often it happens as to how effective this is for user experience, but when opening a record, I save the Modified date and time to a Variable and then before saving, make sure the current modified value is the same. If not, the user gets a message that the record has been modified since they opened it. They can then copy whatever they have input off somewhere (you could actually set a record variable with this), close and re-open the record (and see the updated changes) and apply their changes and save.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @CSilva ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,634)