Blog
SharePoint - How to fix the "skip to main content" error message on integrated forms, or to fix forms where records don't save
May 23. 2021
Why do I receive a "skip to main content" message when I attempt to save a record on a SharePoint integrated form? This post describes this problem that app builders sometimes encounter.
There's a confusing condition that can arise when app builders attempt to build SharePoint integrated forms. On the save event, the record fails to save and instead, the user sees the message "skip to main content". Alternatively, the record fails to save and no error appears whatsoever.
This post recreates this condition and describes the most common cause.
What's the cause of this error message?
This post recreates this condition and describes the most common cause.
What's the cause of this error message?
In almost all cases, the cause of this problem relats to missing mandatory fields, or SharePoint server errors that are generated due to input data that fails to meet validation rules.
The reason this behaviour is confusing is because the error provides no indication that this is the cause of the issue.
Here's a forum post that highlights this issue.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Sharepoint-New-Form-save-not-working/m-p/563024
Recreation of the "skip to main content" error
To recreate this issue, let's take the example of a SharePoint list of products. In this list, there are two mandatory columns - Title and Description. Let's now create a customized SharePoint form and add just one of the mandatory fields - Title.When we attempt to create a new record through this form, we see the error message "skip to main content".
How to better identify missing data values
In practice, it can be very difficult to determine where the problem lies and which fields are missing, particularly with SharePoint lists that contain many columns.
To help identify the cause, we can display the exact error message that SharePoint reports when it fails to add or to amend a record. To do this, we can add the following formula to the OnFailure property of the form (we would substitute Product with the name of the target SharePoint list).
To help identify the cause, we can display the exact error message that SharePoint reports when it fails to add or to amend a record. To do this, we can add the following formula to the OnFailure property of the form (we would substitute Product with the name of the target SharePoint list).
Notify(First(Errors(Product)).Message)
At run time, the form will now display a notification that indicates the missing field, rather than nothing or the meaningless "skip to main content" message.
Conclusion
When records fail to save on SharePoint integrated forms, the most likely cause is missing mandatory data, or input data that fails validation rules. We can more easily identify the cause of the problem by adding formula to the OnFailure of the form.
- Categories:
- sharepoint
Previous
Related posts
- SharePoint - Deleting the last record from a SharePoint list - how NOT to do this!
- Walkthrough - An beginners guide to building an app that stores images in SharePoint
- SharePoint - What to do when there's a mismatch between times in Power Apps and SharePoint
- SharePoint - Filtering lists by User() is now delegable
- SharePoint - Use this trick to perform a 'contains' type search in a more delegable way
- Sharepoint - Filtering records by yes/no columns bug - now fixed!
- Configuration - How to set the SharePoint address of a data source with a variable
- Data - How to make a copy of a record
- SharePoint - How to export and import lists and maintain lookup relationships
- SharePoint - how to fix list threshold errors when working with very large lists
- Data - How to move SharePoint sites, lists, and data
- Code - Can we hack SharePoint ID columns to be delegable using the greater than/less than operators?
- SharePoint - How to filter records by the current user
- SharePoint - Beware of numeric calculated columns!