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 / App Corrupted After Tr...
Power Apps
Unanswered

App Corrupted After Trying to Change Primary Key Field on A Form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a SQL Server Backend and I had my PowerApps app working fine until I tried to change a field on my form linked to the primary key of my data source.  After I did that, I received a message "The specified record was not found. Server Response: Resource not found".  I read on the forum that  changing the primary key on a record after it has been created is not supported.  That disappointing.  What's worse is that after I close and restarte the App, I continually get the same error message.  I deleted all the data from all of my tables in my SQL Server Database and I still get the same error mesage.  I even tried to drop and recreate the table that I thought was impacted and it still doesn't resolve the issue.  I also tried recovering from an earlier version of my app and it still didn't work.   It's as if trying to change the primary key on a form corrupted my application or my database or both.  I'm basically dead in the water.  This happened to me 2 days ago as well on a different screen in my app.  I recreated the form from scratch and that was the only way I could get things working again.  This points to the app somehow being corrupted, but recovering from an earlier version of the app didn't solve the problem this time so I am stumped.

 

I should point out that I have foreign key relationships/dependencies set up in my sql server database which was doing a nice job maintaining referential integrity in my App.

 

Has anyone run into these issue and do you have a resolution.

 

Thanks,
Jeff

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

     

    I think this reason here should be PowerApps is using the Primary Key to identify the row in SQL Table, so changing the Primary key value within PowerApps may not work, as PowerApps can't identify the proper row.

     

    For a workaround, please consider to have the Primary key set to auto_increment, which is handled by the data source side, so that it can't be changed (but readable) under PowerApps.

     

    Regards,

    Michael

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Michael,

     

    Thanks for your reply.  I understand that Powerapps doesn't support changing the value of a primary key.  The bigger problem is that when I did change the value of the primary key by mistake, it corrupted the screen of my application.  I tried everyting to recover the screen.  I logged out and logged back in. Restarted Powerapps.  I deleted all the rows from all of my tables in the database. I even tried to recover an older version of the applicaton from before the key was changed.  Nothing worked.  The application and all of its older versions of that screen were corrupted.   When this happened earlier to me, I had to recreate the screen from scratch.  The second time this happened to me, I worked for hours and finally figured out that if I delete the primary key fields from the screen/form and re-add them, the problem/corruption is fixed.  I want to use regular fields as key fields as it makes more sense in setting up the relationship rules on the backend.  I was simply going to make those fields view only on my powerapps screens,  which highlights a second major issue with Powerapps.  I was testing the displaymode.view  on one of those primary key fields.  It looked like a view only field because it took the border away but it allowed me to changed the value of the field and save it.  I thought diplaymode.view would give you a view only view of a field and not let you change it.  that was not the case.  When you combine that issue with the other issue, you have a giant Powerapps headache.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    I just received an automated email asking if I received the answer I needed. No, the issue is not solved
  • bdc604 Profile Picture
    158 on at
    I feel your pain. 4 days customizing a multiscreen form for SP, no way to dl/export. It buggered right up, even after trying to remove all code and restoring prev versions. Combo box lists were flying off to weird places, flashes way beyond post backs, datacard values getting rejected when referenced. fml.
  • bdc604 Profile Picture
    158 on at
    the real fun part is going back, documenting and screen shotting ALL the settings and functions, because you can’t keep it as reference, your only option is to delete it. Its associated to a live list whose data and relations are way more important than the form. Atleast there is a 50/50 chance it might be stable next time around... maybe...

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
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard