cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Server Response: A value must be provided for item

Hi all,
I'm getting this error when trying to submit a form to a sql server.

The form is a 'New' form and is called with a Newform(form1), every value in the table has an assigned text input to it.

The 'Item' value for the form is left blank as I have been told a 'New form' - that just writes new values - doesn't need an Item property.

So why do I get this error?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Server Response: A value must be provided for item

Hi @Connor_Taylor,

Yes. you are right. Please check if you have defined a PRIMARY KEY within your SQL table.

If you don't define a PRIMARY KEY within your SQL Table, when you generate an app from your SQL table, it would not generate the "Edit" screen.

More details about the limits of SQL Server connector, please check the following artcile:

https://docs.microsoft.com/en-us/connectors/sql/#known-issues-and-limitations

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Community Support Team
Community Support Team

Re: Server Response: A value must be provided for item

Hi @Connor_Taylor,

Could you please share a bit more about your scenario?

I have made a test on my side (leave blank within Item property of Edit form), and don't have the issue that you mentioned.

Please check if you have displayed all required/mandatory fields within your Edit form. Also please check if you have provided valid/proper values for these required/mandatory fields of your SQL table.

The user @Connor_Taylor has faced same issue with you, please check the response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Submitting-a-form-for-a-new-record-Item-value...

Please take a try to set the DefaultMode property of the Edit form control to following:

FormMode.New

then check if the issue is solved.

Please also take a try to re-create your app, and then check if the issue still exists. 

In addition, you could also consider submit your form data into your SQL table using Patch function instead of SubmitForm function. The standard format of Patch function as below:

Patch(
  'YourSQLTable',
   Defaults('YourSQLTable'),
   {
    Column1: DataCardValue1.Text,
    Column2: DataCardValue2.Text,
    Column3: DataCardValue3.Text,
    ...
    Column6: DataCardValue6.Selected.Value,
    ...
   }
)

More details about Patch function in PowerApps, please check the following article:

Patch function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Re: Server Response: A value must be provided for item

Thanks for the help @v-xida-msft

I tried to remake the app this time with the "start from data" template and instead of 3 screens, I only get 2 screens the "Edit" screen is missing, could this be an indication of the problem I am facing?

 

Thanks

Re: Server Response: A value must be provided for item

Seeing tutorials online, could it be that my table doesnt have a primary key that is auto-generated? Is there anyway to work around this

Community Support Team
Community Support Team

Re: Server Response: A value must be provided for item

Hi @Connor_Taylor,

Yes. you are right. Please check if you have defined a PRIMARY KEY within your SQL table.

If you don't define a PRIMARY KEY within your SQL Table, when you generate an app from your SQL table, it would not generate the "Edit" screen.

More details about the limits of SQL Server connector, please check the following artcile:

https://docs.microsoft.com/en-us/connectors/sql/#known-issues-and-limitations

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.