web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Answered

Sudden Patch Error

(0) ShareShare
ReportReport
Posted on by 101

I am suddenly getting a patching error and have (I think!) traced it to the OnSuccess function of my form.  This was working fine last week but now I am getting this error:

"Network error occurred on the server"

 

I removed all the patch functions from the OnSuccess property and left the Notify and Reset form functions.

 

Still giving me the same patch error even though I removed all the patch functions.  Any idea of what to check next?

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @StacyO 

    Difficult to say without any code to reference

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @StacyO ,

     

    It would be possible that data structure of the data source the form connecting to has been changed. Please refresh the connection, add the form to your App again. SubmitForm function uses the Patch method as well, the error could be due to this function. 

     

    Best regards,

  • StacyO Profile Picture
    101 on at

    my apologies - I have a button with the SubmitForm function, OnSelect property: 

    Set(
        varOppSubmitDialog,
        false
    );
    If(
        OpportunityForm.Mode = FormMode.New,
        Set(
            varReqStatus,
            "New Request"
        )
    ); //set for OnSuccess functions
    SubmitForm(OpportunityForm);
    Navigate(Screen_Main);

     

    in the form's OnSuccess is where I put the Patch function which updates 2 choice fields, a date field and 2 text fields.

     

    StacyO_0-1717697212149.png

    Hopefully this provides enough context.  Thanks!

  • StacyO Profile Picture
    101 on at

    I've refreshed the connection, checked all required fields, removed the buttons and added them again.

    I've removed all Patch functions from the OnSuccess property, leaving only a Notify function.  Still gave me a patch error.  I put a simple button on the form with just a random patch and that worked. The monitor is giving me a 502 Bad Gateway errors where it tries to Create the Row.  Is there an issue with my form?

    Do I need to rebuild the form?

  • StacyO Profile Picture
    101 on at

    I've nailed it down to one of my Combobox fields. When I remove the field there is no error.  When I add it back then the Patch error:   

    "Error reading string. Unexpected token: StartObject. Path 'Value', line 2, position 13.\r\nclientRequestId: 9c607a94-2e32-4511-9685-b89dad844de0\r\nserviceRequestId: a21430a1-1037-0000-2dcd-bce661b6caf0"

     

     Here are the property settings:

     

    Items: If(varShowLaborFields= true,Choices([@'My SharePointList'].'Cost Element'),Distinct(Filter(

    'My SharePointList',Vendor=cmbVendor_1.Selected.Value),'Cost Element'))

     

    DefaultSelectedItems: ThisItem.'Cost Element'

     

    Update: cmbCostElementOpp.Selected

     

     

    NOTE:  I have nearly this same field configuration in use on another form in my app and it works fine.  I've removed the field, added it back again.  still same error.

  • Verified answer
    EddieE Profile Picture
    4,641 Moderator on at

    @StacyO 

    This formula

    // re-written
    If(
     varShowLaborFields,
     // this is a Choices table, usually 2 columns
     Choices([@'My SharePointList'].'Cost Element'), 
    
     // this is a single column table
     Distinct(
     Filter(
     myList, Vendor=cmbVendor_1.Selected.Value
     ),
     'Cost Element'
     )
    )

     

    Is confusing your data source by the looks. You are creating 2 different schemas for the ComboBox Items depending on the value of the variable varShowLaborFields. This doesn't work for the Form Submit / Patch.

  • StacyO Profile Picture
    101 on at

    what I'm trying to do that if the variable is true then I need all choices in the list for that column, if false then I need a filtered list from that same column.  It's the same list for both functions.  Is there another way to accomplish this?

  • StacyO Profile Picture
    101 on at

    Ok.. so you led me down the right path.  I was able to create a variable and use that  to avoid the schema confusion and it works.  Thank you so much!

  • EddieE Profile Picture
    4,641 Moderator on at

    @StacyO 

    Well done on solving this. Always rewarding to build the solution yourself 🙂 

  • StacyO Profile Picture
    101 on at

    Appreciate your help!!! I don't know what I'd do without this community! 🤗

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard