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() vs UpdateIf() ...
Power Apps
Unanswered

Patch() vs UpdateIf() - what are the differences, pros and cons

(0) ShareShare
ReportReport
Posted on by 471

I realise almost this same question has been asked before, and answered by @Mr-Dang-MSFT, but I'm looking for a broader answer than the specific example in that post.

 

I understand that Patch changes a single record, while UpdateIf can update a whole set of records.

 

I want to understand the performance difference of one vs the other on the same task. So patching a single record, or using UpdateIf with a condition that will match a single record.

 

In my case, Patch was generating an etag mismatch, but UpdateIf just works. So ultimately it's a question of whether using UpdateIf is going to compromise performance compared to using Patch?

 

 

Bonus question: I'm not sure why Patch wouldn't work for me, I'm sure the same function was working a few weeks back. I followed some related forum posts which suggest doing a refresh prior to the patch - didn't fix it. A potential quirk in how I'm using it is that I collect all my data locally, then have a button inside a gallery displaying that collection, which does a patch back to the original datasource (SharePoint List) filtered on the matching ID.

Categories:
I have the same question (0)
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @davidstone wrote:

    I want to understand the performance difference of one vs the other on the same task. So patching a single record, or using UpdateIf with a condition that will match a single record.


    Both ForAll(Patch()) and UpdateIf() will be heavy actions in terms of performance. 

     

    But it is sounding like it's a non-starter for you to use Patch(). What's the formula you're using with it that is causing an ETAG mismatch?

  • davidstone Profile Picture
    471 on at

    It's:-

     

    Patch(Events, LookUp(Events, ID = ThisItem.ID), { Approved: "Yes" })

    So basically the gallery lists events which are currently not approved. Each row has a button that let's you approve with one click.

  • davidstone Profile Picture
    471 on at

    Also I'm not using a ForAll with my patch - it only needs to update the one record clicked on.

  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @davidstone I'm looking into the ETAG mismatch issue.

     

    Can you run these steps:

    • Create a blank app
    • Insert a list screen and connect it to an SP list
    • Patch a change to a record in the SP list
    • Observe the ETAG mismatch error and get a session id

    Repeat steps, but with UpdateIf instead of Patch and get a second session id.

  • davidstone Profile Picture
    471 on at

    Hmm, the plot thickens...

     

    I just did as you said, created the app, and the error didn't occur. The only difference from my app is using a list-view pointed to a local collection, so I added a screen in the app for that too... still no error.

     

    So to get a reliable example of the issue I went to the original app that triggered this post, and un-commented the line that was causing the issue... no issue!

     

    This is, at least, consistent with what I had thought, which is that original code had been working when I first put it in about a month ago.

     

    I guess from here I should just look out for it, and if I see an etag mismatch, get my session ID and let you know?

     

    Thanks.

  • luuminhvuong93 Profile Picture
    300 on at

    @Mr-Dang-MSFT   Hi Brian , sometimes I faced issues with patching updates to sharepoint lists (Etag mismatches ) too,

    Wonder whether you know what might be the root cause, and how to avoid this in PowerApps,

  • Venn77 Profile Picture
    22 on at

    I too am interested in this... it's affecting some of our users HEAVILY. And UpdateIf() is simply not usable, with Patch() it takes 5 seconds to update a record, it takes 40 seconds with UpdateIf(). Need to solve the ETAG mismatch errors.

  • KPOak-MDIT Profile Picture
    3 on at

    amiyauge41's post sure looks like a spearfishing attempt.  Don't click that PDF icon.

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 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard