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 / Sometimes Patch doesn'...
Power Apps
Answered

Sometimes Patch doesn't work

(0) ShareShare
ReportReport
Posted on by 100

Hi All,

 

In the gallery of an app the user can select a button to trigger an update.

 

In addition to several other statements, which work fine, a Patch is initiated:

Patch(Tabel2;First(Filter(Tabel2;Achternaam=AfAchternaam And Voornaam=AfVoornaam));{LaatsteAfboeking:AfAfboekingDatum;Saldo:AfSaldo-1})

Remark: the ';' is what we use in The Netherlands. It reacts as a ','.

 

The patch updates a SharePoint list.

Sometimes (less than 5% of the updates done by users) the record is not updated.

And there is no error detected in the Error-table.

I'm 100% sure the record exists in the SharePoint list.

I've updated the app somewhere else and published a new version.

After that I have this problem. I worked fine for 1,5 years.  

 

Hopefully somebody knows what the problem is.

And how can I detect if the record is updated?

 

Thanks in advance.

Ron

 

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

    Hi @RonHappel ,

    Try this as a more direct selection of the (first) matching record

    With(
     {
     wID:
     LookUp(
     Tabel2;
     Achternaam=AfAchternaam && Voornaam=AfVoornaam
     ).ID
     };
     Patch(
     Tabel2;
     {ID:wID};
     {
     LaatsteAfboeking:AfAfboekingDatum;
     Saldo:AfSaldo-1
     }
     )
    )

    I am assuming the value starting with Af are variables.

     

    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.

  • RonHappel Profile Picture
    100 on at

    Hi Warren,

     

    Thanks for your quick reply.

    I do have some questions.

    I'm guessing the First(Filter function is not reliable. Do you think that too?

    Why is your solution more reliable?

    It is an idea to replace my First(Filter part of the statement to a LookUp, or is that not enough?

     

    Regards, Ron

  • Verified answer
    WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @RonHappel ,

    LookUp() is a more direct approach as it simply finds the first matching record. I am also using the With() statement to first find the record ID in isolation and then Patch specifically to it. This may be a bit of "overkill", but I generally resort to specifics when I find intermittently unreliable code.

     

    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.

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

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard