Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

The item has already been created on the server

Posted on by 264

Hi,

 

I have an app connecting to Sharepoint lists and I am gettign the error "The item has already been created on the server......." - see attached screenshot.

 

I do not get this when I run PA from the web page - only when I run it from my sharepoint - I have it embedded in an iFrame.

 

It is a random error - I only get it when I go into the main screen of my app which is loading a lot of Shaepoint data from a list, but not all the time - sometimes it is fine. I have a decent connection to the internet - approx 70mbs download but only 2mbs upload - not sure if that matters.

 

I am not saving a thing at this point - simply loading the forms - multiple forms based off the same list - yes I can have 2 forms being loaded with the same data from the same field.  Still not saving anything as far as I am aware.

 

Is there a way to troubleshoot this to find out what might be causing the conflict?  

 

Anyone seen this before?

Categories:
  • Suggested answer
    CU02100205-0 Profile Picture
    CU02100205-0 2 on at
    The item has already been created on the server
    The answer Exist here. Simple, unlike OnChange event or whatever that's been said above.
    https://www.reddit.com/r/PowerApps/comments/1enqwfb/network_error_while_patching_this_item_is_already/

    Refresh(datasource) BEFORE submitForm(Form_xxx) action within onselect property of ur button. Simple straightforward, get rid of this BullS*it pesky "The item has already been created on the server"
     
    Thanks
  • PowerBIDine Profile Picture
    PowerBIDine 8 on at
    Re: The item has already been created on the server

    Hi,

     

    Anyone Did resolve this issue, 

    I have added same kind of records many times, but after 2 days i am facing same issue, when click "SUBMIT " Button.

     

    ERROR -  Network Error When patch Function :- this item has already created on server

     

    {
      "status": null,
      "duration": null,
      "dataSource": null,
      "responseSize": null,
      "controlName": "Button1",
      "propertyName": "OnSelect",
      "nodeId": 2,
      "formulaData": {
        "script": "SubmitForm(Form)",
        "spanStart": 0,
        "spanEnd": 16
      },
      "data": {
        "errorMessage": "Network error when using Patch function: The item has already been created on the server.",
        "raiseToastNotification": false,
        "wasReported": false,
        "functionName": "Patch",
        "context": {
          "entityName": "Button1",
          "propertyName": "OnSelect",
          "id": 2487,
          "nodeId": 2,
          "diagnosticContext": {
            "formula": "SubmitForm(Form)",
            "span": {
              "start": 0,
              "end": 16
            }
          }
        },
        "info": "Network error when using Patch function: The item has already been created on the server."
      }
    }
     
    Could someone help regarding this????
  • Gargoolgala Profile Picture
    Gargoolgala 264 on at
    Re: The item has already been created on the server

    I added a variable to check the onchange event and this method worked but it was not ideal.

     

    After logging a support call with MS they did confirm that when a record changes it is considered a OnChange event.

     

    In the end I removed my OnChange events completely and used a different method based on the data card being visible or not and setting the Update value based on the visibility e.g. If(datacardvalue.Visible=true, datacardvalue.Text,txtEmpty.Text) where txtEmpty.Text is a generic value I can work with e.g. N/A

  • Verified answer
    Gargoolgala Profile Picture
    Gargoolgala 264 on at
    Re: The item has already been created on the server

    Bdodu,

     

    yes - this is exactly what I was intending on doing(glad you are thinking the same way) - although I have also logged a support call as I do not think OnChange should be triggering just because of a new record.

     

    I was hoping to avoid working around what seems to be a bad design - in my head at least 🙂

     

    Do you know if OnChange is intended to trigger even if I am simply switching records?  BTW - If I open record 1 - get the error - then go back to home page - open record 1 again it gives no error - I assume as it is still on the same record and nothing has changed.

     

    Thanks for the help -  I will let you know if it works.

  • Verified answer
    bdodu Profile Picture
    bdodu 399 on at
    Re: The item has already been created on the server

    in your case OnChange executes multiple times and therefore you need to keep a hidden original value.

    Before your patch check the old value to see if you really need to execute a patch. This way the onchange will not execute and you will get rid of the ugly error.

     

    Write an IF in front,  something like if( <changed?>, <your_original_if>, false), where <changed> is the comparison with the hidden value.

  • Gargoolgala Profile Picture
    Gargoolgala 264 on at
    Re: The item has already been created on the server

    What seesm to be happening is the OnChange event is causing this issue.  I have the following in my onChange:

     

    If("Windows" in dcvServerOS.SelectedItems.Value,false,Patch('Secure Print Assessments',First(Filter('Secure Print Assessments', ID=SelectedCustomer.ID)),{ServerOS:dcvServerOS.SelectedItems,WindowsServerOS:lbEmptyMulti.SelectedItems.Value}));If("Windows" in dcvServerOS.SelectedItems.Value,false,Reset(dcvWindowsServerOS));If("Other" in dcvServerOS.SelectedItems.Value,false,Patch('Secure Print Assessments',First(Filter('Secure Print Assessments',ID=SelectedCustomer.ID)),{OtherServerOS:txtEmpty.Text}))

     

    My goal here is that when I seelct certain values in a combobox I will either reset another field pending what my choice is - basically if I remove Windows as an entry then I want anohter field set to empty by patching it to a null value of an empty combobox.  I then reset the combobox which has been patched to null in my SP List.  I also have a similar rule based on Other.

     

    If  I remove the onChange event I do not get the error.   What seems to be happening is the onChange event kicks in when I open a form for that record - I only want it to trigger when I actually change a value - not when I load the form.

     

    Any ideas on how to avoid the OnChange event when the form loads a new record?  Or a better way to reset the combobox to a null value?

  • Gargoolgala Profile Picture
    Gargoolgala 264 on at
    Re: The item has already been created on the server

    I have many OnChange events in the form but I would hope that when simply opening a form it does not consider that to be a OnChange event.

  • bdodu Profile Picture
    bdodu 399 on at
    Re: The item has already been created on the server
  • bdodu Profile Picture
    bdodu 399 on at
    Re: The item has already been created on the server
    Are you updating the list with Patch ? May be on the OnChange event of one control?
  • Gargoolgala Profile Picture
    Gargoolgala 264 on at
    Re: The item has already been created on the server

    Mona,

    if you mean web parts in my sharepoint site then no - I have no other web parts - it is the only one.

     

    Is ther a way to debug - PA needs to help us help ourselves

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard