Blog
Forms - When calling SubmitForm, how to debug the error "Network error when using Patch function"
If you receive the error "Network error when using Patch function", here's a quick demonstration and walkthrough of how to diagnose this error.
Walkthrough - diagnosing the "Network error when using Patch function" error
To demonstrate, here's an example of a pre-built app that was created with the 'start with data' feature of Power Apps. No changes have been made to this app. When we run the app and attempt to save a record, we receive the following error.
The error indicates that a specified column is read-only and can't be modified. How do we identify the name of the column that causes this error?
Once the Monitor is open, we can run our app in the designer and recreate the bug. We then review the trace (as shown beneath). Here, we see the name of the column that causes the error - cre23_isimportant in this example. Note that the errors are conveniently highlighted with a red exclamation mark, therefore making them easy to find.
We can now fix our app by removing making this field non-editable in the form designer.
This is just one example of something that causes the "Network error when using Patch function" when calling SubmitForm. Other common causes I see include:
- Submitting a form that attempts to create duplicate values in a column that's configured to accept unique values only
- Submitting a form that includes a card that links to a calculated column
- Submitting a form that violates some other server-side validation rule
Conclusion
- Categories:
- debug