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

Resetting form Error - The item has already been created on the server.

 

 

Hi,

 

I am having trouble resetting a "new form" following an entry. The first entry is currently successful however when trying to submit another entry I am getting the following error "The item has already been created on the server."  I am currently using the below code to submit form to the database.

 

PowerApps - 2nd Entry.pngPowerApps - 1st Entry Successful.pngPowerApps - Error Msg.png

 

1st entry successfully submitting.     2nd entry to submit to database.       Error occurring following 2nd entry.

 

If(
   Checkbox1.Value = true,
   ForAll(
             Split(DataCardValue10.Text, "&").Result,
             Patch('[dbo].[ProjectShipment_1]',Defaults('[dbo].[ProjectShipment_1]'),EditForm1.Updates)), Patch('[dbo].[ProjectShipment_1]',Defaults('[dbo].[ProjectShipment_1]'),EditForm1.Updates));Reset(BarcodeScanner1);ResetForm(EditForm1)

 

There are two objectives of this code.

  1. Split each scanned barcode at & and create a new entry within the database whilst keeping the reset of the data on the form the same. QA, Location etc remaining the same.

PoweraApps Multiscan.png

 

              Result of Multiscan submission

This is currently not working. Do I need to add additional information into the patch function?

 

Barcode scanned

QA

Location stored

Zone Stored

Date Received

Received by

P000008200-0010

Damaged in transit

Offsite storage 1

Zone A

June 6, 2019

 

P000008200-0022

Damaged in transit

Offsite storage 1

Zone A

June 6, 2019

 

P000008200-0003

Damaged in transit

Offsite storage 1

Zone A

June 6, 2019

 

How data should be submitted to the database.

 

  1. Submit the data to the database and reset the form allowing the user to continue onto a new entry.

First entry successful, subsequent entries coming up with the error message.

 

Any help on what I am missing to ensure data is refreshed/cleared after submission would be greatly appreciated.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Resetting form Error - The item has already been created on the server.

Hi @S_chap 

 

On your side

Could you please change your formula expression as this:

Button.OnSlect:

ClearCollect(test,Split(DataCardValue10.Text,"&").Result);ForAll(test,If(Checkbox1.Value=true,Patch('[dbo].[ProjectShipment_1]',Defaults('[dbo].[ProjectShipment_1]'),{Column1:Column1'sDataCardValue.Text,

Column2:Column2'sDataCard.Text,...

CodeNumberColumn:test[@Result]})));ResetForm(EditForm1)

 

Test On my side:

PATCH1.PNG

PATCH.gif

 

 

 

 

Hope this could be helpful.

 

Best Regards.

Yumia

1 REPLY 1
Community Support Team
Community Support Team

Re: Resetting form Error - The item has already been created on the server.

Hi @S_chap 

 

On your side

Could you please change your formula expression as this:

Button.OnSlect:

ClearCollect(test,Split(DataCardValue10.Text,"&").Result);ForAll(test,If(Checkbox1.Value=true,Patch('[dbo].[ProjectShipment_1]',Defaults('[dbo].[ProjectShipment_1]'),{Column1:Column1'sDataCardValue.Text,

Column2:Column2'sDataCard.Text,...

CodeNumberColumn:test[@Result]})));ResetForm(EditForm1)

 

Test On my side:

PATCH1.PNG

PATCH.gif

 

 

 

 

Hope this could be helpful.

 

Best Regards.

Yumia