cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jpyszkowski
Level: Powered On

Patch function to SQL table with Identity ON.

Hello,

 

I am trying to develop a simple app that allows me to update values in a SSMS table. The column id_num is set to Identity yet I still get the error that my Datasource needs to be a collection. Can Powerapps directly update a SQL server table? Do I need to update the collection first and then send those updates to SQL?

 

Any help is appreciated. Thanks.

image.pngimage.png

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Patch function to SQL table with Identity ON.

Hi @jpyszkowski 

I think this is because your id_num isn't set as a primary key. If you right click the id_num column in SSMS (in the top part of the grid in your second screenshot), there should be an option to set the column as primary key.

After you do this in SSMS, you'll need to refresh the datasource in PowerApps. There have been some cases in the past few weeks where it's taken some time for such changes to take effect, but this should hopefully solve your problem.

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Patch function to SQL table with Identity ON.

Hi @jpyszkowski 

I think this is because your id_num isn't set as a primary key. If you right click the id_num column in SSMS (in the top part of the grid in your second screenshot), there should be an option to set the column as primary key.

After you do this in SSMS, you'll need to refresh the datasource in PowerApps. There have been some cases in the past few weeks where it's taken some time for such changes to take effect, but this should hopefully solve your problem.

View solution in original post

jpyszkowski
Level: Powered On

Re: Patch function to SQL table with Identity ON.

@timl Thank you much. Took about 5 mins for powerapps to refresh and pick up that change.

Super User
Super User

Re: Patch function to SQL table with Identity ON.

You're welcome, glad that solved the problem.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,682)