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 / Patch function does no...
Power Apps
Unanswered

Patch function does not update record correctly if same record is updted my multiple user

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have one master list in sharepoint containing Capacity for Location, date and slot. When multiple users are booking from PowerApps forms for same Location, date and slot. Capacity is master list is not updating correctly. It only reduces by 1 and not by 3. For example, in master list lets say capacity is 10 for particular Location, date and slot. And 3 users booking for same Location, date and slot. All 3 users are getting message that booking made suxccesfully. But capacity is only reduced by 1. We are using Patch function for updating Master record. Due to this Master List is not showing correct capacity.  

Categories:
  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you share a bit more like what is you currant formula? that will help your chances of getting resolved quickly 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Below code we have written on button Onselect event. To validate and than Patch.

     

    If(Value(Label7.Text)<>5 && !(IsBlank(DataCardValue2.Text)),Notify("Please enter valid WWID."),
    If(
    DataCardValue60.Selected.Result = "<select>" || IsBlank(DataCardValue53.Text),
    Notify("Please select location."),
    Set(
    VarStatus1,
    "Booked"
    );
    Set(
    varCapacity,
    DataCardValue53.Text
    );
    IfError(
    SubmitForm(SharePointForm1),
    Notify("Please enter all the required details."),
    If(
    Value(varCapacity) - 1 < 0,
    Notify(
    "Something wrong, please do refresh the page.",
    NotificationType.Error
    ),
    ClearCollect(
    colAfterPatchMaster,
    Patch(
    Master,
    First(
    Filter(
    Master,
    Title = DataCardValue60.Selected.Result && Vaccination_x0020_Date = DataCardValue58.SelectedDate && Slot = DataCardValue24.Selected.Slot
    )
    ),
    {Capacity: Value(DataCardValue53.Text) - 1}
    )
    )
    );
    Set(
    afterPatchCapacity,
    First(colAfterPatchMaster).Capacity
    );
    If(
    Value(varCapacity) - Value(afterPatchCapacity) = 1,
    SubmitForm(SharePointForm1);
    Office365Outlook.SendEmailV2(
    User().Email,
    "Vaccination Registration is completed successfully.",
    HtmlText1.HtmlText
    ),
    Notify(
    "Something went wrong..",
    NotificationType.Information
    )
    )
    )
    ));

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard