Hello @Sando2991
Without knowing the full details of your app, It sounds like the record that you are passing in the patch to update the datasource is also trying to update the primary key column. The 3rd parameter ( record object as specified between two {} ) should not contain the primary key.
The 2nd parameter is used to identify the record that Patch should update. You can either use the object below as example, or you can replace the second parameter with a lookup function, but this is overkill and we have noted some slight performance downfalls for this as well, so we prefer the below mentioned 2nd parameter.
Patch(Leave,{ID:34},{Title:"test",reason:"PowerApps is Awesome"})
I hope you come right, please let me know if you don't
Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions.