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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Prohibit multiple user...
Power Apps
Answered

Prohibit multiple users on Powerapp or SharePoint list

(0) ShareShare
ReportReport
Posted on by 71

Hi

I have a Powerapp that uses a SharePoint list "Books" that holds titles, authors and number of copies of each book. Students can choose just one book and than automatically the number of copies decreases with one copy. If the number of copies of a certain book has become 0 (zero) than the book disappears from the gallery where I show the SharePoint list in.

Now since multiple students can have access at the same Powerapp at the same time I sometimes end up wth a book showing -3 copies. 

f.e. A book has 4 copies and there are 6 students who choose that book at approximately the same moment I end up with -2 copies for that book and the book still shows up in the gallery since the number of copies is not equal to 0.

 

How can I avoid that I end up with negative saldo of copies, so when the number of copies becomes 0 that book should disappear from the gallery also for users who are watching the app at that moment. I can't find any way.

Maybe I could prevent the use of the powerapp for different users at the same time, so let's say if one students uses the powerapp the other students must wait to open it until the firtst student has chose a book and ended the app. Is that perhaps possible?

 

Thx a lot for your advice.

Greetz

Walter

 

Categories:
  • zmorek Profile Picture
    3,272 on at

    I guess there's a few ways it could be handled, on the OnSubmit property of whatever button you have, perhaps add a Refresh(DataSource) to the top row. Then after that, a simple If() statement could work:

    Refresh(DataSource);
    If(
    LookUp(
    DataSource, TitleColumn = ThisItem.Selected.Title, NumberRemainingColumn
    ) = 0,
    Notify("No more books to check out",Error),
    [formula to check out book]
    )

  • Walter Profile Picture
    71 on at

    Hi zmorek

     

    Thx a lot for your suggestion. I already tried something likewise before and ok it works perfect for the screen that the student, who has just picked a book, sees. But what about the students who have the same app opened. They don't see the refreshment of the screen, so they still see that a certain book has still one copy although in reality the book has zero copies. So there should be someting possible like...

    1. Refresh all screens of other app-copies that are opened by other students

    or

    2. Prohibit a student to open the app until another student has closed it.

     

    Is there a kind of solution for this.

     

    Thx and greetz

     

    Walter

  • Verified answer
    zmorek Profile Picture
    3,272 on at

    You can also try refreshing the data source with a hidden timer, please see here: https://blog.pragmaticworks.com/how-to-refresh-power-apps-data-sources-on-a-timer#:~:text=This%20is%20where%20the%20timer,and%20auto%20repeat%20that%20timer.

     

    That way, every X seconds that gallery can refresh and reflect an updated amount of books left.

  • Walter Profile Picture
    71 on at

    Hi zmorek

    That did the trick! Thx a lot!! 😊 This communicty rocks! Every day I'm learning from you guys. Very gratefull for all you members and contributors.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard