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 / Unable to Modify / Del...
Power Apps
Answered

Unable to Modify / Delete SQL Record

(0) ShareShare
ReportReport
Posted on by

Hi everyone!

 

I'm having a small hiccup here and not sure what's the cause for the issue and hope that the community could offer some hints or insights into the problem.

 

Issue: Previously I can add, modify, and remove records from a SQL db. Today, it seems that I am unable to do so.  No code has changed and the error is stating that:

"The specified record was not found. Failed to update item xxx"

MrNguyen_0-1666288304327.png

 

The patch expression is as followed:

MrNguyen_1-1666288411084.png

 

If I run a similar expression in SQL it works just fine:

MrNguyen_3-1666288684460.png

MrNguyen_4-1666288723282.png

 

Interesting enough, my REMOVE expression does not return an error but also does not delete any record(s).

Tested a similar code against SharePoint Online and everything works as expected.

 

Is anyone else having issues saving to a SQL table? Any help would be greatly appreciated!

 

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MrNguyen 

    Focus on your primary key!  

    Patch(yourTable, {PK: PKValue, CASH...})

     

    So, if you have to use a lookup because you have not established the record PK prior, then it would be:

    Patch(yourTable, {PK: LookUp(yourTable, <criteria>, PK), CASH...})

     

    The same goes for Remove -  Remove(yourTable, {PK: PKValue})

     

    If none of the above works, then there is some other issue going on.

     

    I hope this is helpful for you.

  • CU24061526-1 Profile Picture
    on at

    Thanks @RandyHayes ,

     

    Attempted that and it didn't work. Still says record not found. Gonna still try to take a whack at this a bit longer. Thanks for the suggestion!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @MrNguyen 

    Yeah...something else is an issue then beyond your formulas.  If you are providing the primary key, then that is all it needs.  If it can't find it, then either your datasource needs to be refreshed or there is some other problem on the data gateway side.

  • CU24061526-1 Profile Picture
    on at

    @RandyHayes this is totally weird...

     

    So, I was asking another developer to check and guess what? He doesn't have any issues adding, removing, or deleting records! What the..

     

    We both deleted all connections, rebuilt all connections back to SQL, checked our R/W permissions, and we have all the same settings....

     

    very intriguing...

     

    Going to keep digging...

  • Verified answer
    CU24061526-1 Profile Picture
    on at

    Going to mark this as closed.

     

    Today, everything works as normal again! What the... 

  • slgDev Profile Picture
    4 on at

    I am experiencing the same issue with my some of my SQL Tables and really have no idea what is causing the issue.

     

    I can read and create on the tables normally, but when I am trying to update/delete, it fails with "network error, record not found".

     

    I got correct permissions and everything works fine through SSMS.

     

    Another weird thing is that it happens with a very simple formula, for example:

    Remove(MyTable,First(MyTable));

     

    MyTable has a composite PK of 3 columns.

     

    And the error looks like:

    "Network error when using Remove function: MyTable failed: Item with id 'first record value of composite pk1, first record value of composite pk2, first record value of composite pk3' does not exist."

     

    So I am just trying to delete the first row of the table and the response to that, is that the first record (for which it returns data without me specifying/filtering anything), is not found...

     

    Makes no sense

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