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 / Multiple users accessi...
Power Apps
Unanswered

Multiple users accessing app at the same time - Update datasource issue

(0) ShareShare
ReportReport
Posted on by 603

Hi @WarrenBelz 

 

I have a bidding powerapp with SharePoint as the datasource. The app landing page has a gallery which looks like below where user can bid for items.

 

Iantaylor2050_0-1697858014504.png

 

When two users access the app at the same time and bid for items, two winning bids are being created which is logically wrong.

 

When i access User A screen and User B screen after bidding, below screenshot is being shown which is wrong. Both cannot be winners. 

 

Iantaylor2050_1-1697858653828.png

May i know how to prevent this? This is the below code when user submits the bid successfully.

 

Bid Submission Code

If(
 IsBlank(
 LookUp(
 Bid_Transaction,
 Item_No = quickbidselected.'Item No',
 Bid_Price
 )
 ),
 Patch(
 Bid_Transaction,
 Defaults(Bid_Transaction),
 {
 'Name (Title)': Office365Users.UserProfile(User().Email).DisplayName,
 Designation: Office365Users.UserProfile(User().Email).JobTitle,
 Division: Office365Users.UserProfile(User().Email).Department,
 Bid_Price: Value(Label27_9.Text)+5,
 Bided_DateTime: Now(),
 Item_No: quickbidselected.'Item No',
 Email: User().Email,
 Item_Name: quickbidselected.'Item Name'
 }
 
	))

 

 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    Assuming your test here

    If(
     IsBlank(
     LookUp(
     Bid_Transaction,
     Item_No = quickbidselected.'Item No',
     Bid_Price
     )
     ),
     Patch(
     Bid_Transaction,
     Defaults(Bid_Transaction),
     {
     'Name (Title)': Office365Users.UserProfile(User().Email).DisplayName,
     Designation: Office365Users.UserProfile(User().Email).JobTitle,
     Division: Office365Users.UserProfile(User().Email).Department,
     Bid_Price: Value(Label27_9.Text)+5,
     Bided_DateTime: Now(),
     Item_No: quickbidselected.'Item No',
     Email: User().Email,
     Item_Name: quickbidselected.'Item Name'
     }
     )
    )

     

    is the control (only patch if there are no bids), then that is the best you are going to do (if the bids are less than a few seconds apart, you may have an issue which I have seen many times on similar questions). If not, how is a "winning" bid decided.

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz ,

     

    Winning Bid is decided based on the highest bid price value for that item in the Bid Transaction SharePoint list. 

     

    Since User A and User B bid Toothbrush at the same time for $286, both are shown as winners.

     

    Bid Transaction SharePoint List

     

    Iantaylor2050_0-1697859983145.png

    Winner Label Visible Code

    If(
     First(
     SortByColumns(
     Filter(
     Bid_Transaction,
     Item_No = ThisItem.'Item No' && Email = User().Email
     ),
     "Bid_Price",
     SortOrder.Descending
     )
     ).Bid_Price = Value(Label27_11.Text),
     true,
     false
    )
  • WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    @Iantaylor2050 ,

    You could test for this and get the current highest bid

    First(
     Sort(
     Filter(
     Bid_Transaction,
     Item_No = quickbidselected.'Item No'
     ),
     Bid_Price,
     SortOrder.Descending
     )
    ).Bid_Price

    and then make sure the current bid does not equal this.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

     

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    I got your point. However, I want to prevent concurrent bidding at the same time.

     

    If User A has bid for Toothbrush at $286, User B should see a popup dialog which says There is already a bid submitted by User A for $286. Your next bid value would be $286+$5=$291.

     

    May i know how to achieve this?

  • WarrenBelz Profile Picture
    156,570 Most Valuable Professional on at

    @Iantaylor2050 ,

    If you go back to my first post, you cannot prevent absolute "concurrent" conflicting bids. The exact timing here depends on bandwidth / app performance and may be a few seconds. The best you can do with reliable means is a lookup before patching.

    I will give you a concept to think about, but it has its dangers of false positives and difficulties handling errors (so it is not something I am recommending), but if your Lookup picked up the ID of the latest bid and wrote that to a number field in the new record, you could set that field in SharePoint as requiring unique values, the second one would fail at a SharePoint level (as I mentioned you would then have to try and handle this error and provide a message). 

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard