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 is not updating ...
Power Apps
Answered

Patch is not updating record

(1) ShareShare
ReportReport
Posted on by 42
Hi,
 
I'm having an issue with a patch command that updates records in a gallery.  It works on the first record, but not working on any other line.  below is the code which looks right to me so I'm not sure why it's not working.
 
Patch(
    'Purification-Buffer-Details',
    BufferGallery.Selected,
   // LookUp('Purification-Buffer-Details', ThisItem.BufferID=Value(TxtID.Text)),
    {BufferName: BuffInput.Text,
    Volume:VolInput.Selected,
    BufferComponent:BuffComInput.Selected,
    Salt:SaltInput.Selected,
    Glycerol:GlycerolInput.Selected,
    EDTA: EDTAInput.Selected,
    TCEP:TCEPInput.Selected,
    Imidazole:ImidInput.Selected,
    Additives:AddInput.Selected
 
    }
);
Notify("Your record has been updated",NotificationType.Success,2000)
 
Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,763 Super User 2026 Season 1 on at
     
    I'm assuming the controls that have the data you wish to save are inside the gallery, coorect?
     
    If so, the formula should be updated to reference exactly the instance of the controls to use, since there is a set for each item in the gallery:
     
    Patch(
        'Purification-Buffer-Details',
        BufferGallery.Selected,
        {
           BufferName: BufferGallery.SelectedBuffInput.Text,
           Volume:BufferGallery.Selected.VolInput.Selected,
           BufferComponent:BufferGallery.Selected.BuffComInput.Selected,
           Salt:BufferGallery.Selected.SaltInput.Selected,
           Glycerol:BufferGallery.Selected.GlycerolInput.Selected,
           EDTA: BufferGallery.Selected.EDTAInput.Selected,
           TCEP: BufferGallery.Selected.TCEPInput.Selected,
           Imidazole:BufferGallery.Selected.ImidInput.Selected,
           Additives:BufferGallery.Selected.AddInput.Selected
        }
    );
    Notify("Your record has been updated",NotificationType.Success,2000)
     
     
    If this reply helped you in any way, please give it a Like 💜 and in case it resolved your issue, please mark it as the Verified Answer ✅.
  • Suggested answer
    11manish Profile Picture
    2,509 on at
    Try this:
    Patch(
        'Purification-Buffer-Details',
        ThisItem,
        {
            BufferName: BuffInput.Text,
            Volume: VolInput.Selected,
            BufferComponent: BuffComInput.Selected,
            Salt: SaltInput.Selected,
            Glycerol: GlycerolInput.Selected,
            EDTA: EDTAInput.Selected,
            TCEP: TCEPInput.Selected,
            Imidazole: ImidInput.Selected,
            Additives: AddInput.Selected
        }
    );
    Notify(
        "Your record has been updated",
        NotificationType.Success,
        2000
    )
     
  • Suggested answer
    Valantis Profile Picture
    5,742 on at
     
    where your input controls (BuffInput, VolInput etc.) are located?

    If the controls are inside the gallery: use BCBuizer's approach. Reference them via BufferGallery.Selected.ControlName so Power Apps knows which gallery item's controls to read. Without this, all controls resolve to the first item's instance.

    If the controls are outside the gallery (e.g. on the same screen but not inside the gallery): use 11manish's ThisItem approach. Replace BufferGallery.Selected with ThisItem as the second Patch argument so it patches the current row being processed.

    The reason it only works on the first record is almost certainly that your controls are inside the gallery but you're referencing them without the gallery prefix. Power Apps defaults to the first instance of a named control inside a gallery, which is why record 1 updates correctly and all others don't.

    Check where your controls sit in the tree view and apply the matching fix.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 428

#2
Haque Profile Picture

Haque 338

#3
timl Profile Picture

timl 333 Super User 2026 Season 1

Last 30 days Overall leaderboard