SharePoint users are always redirected to the default list view (AllItems.aspx) after creating a new List Item or submitting a custom form (Save, Cancel, Close - they all do that).
- Create List Item (NewForm.aspx) - Clicking Save or Cancel button redirect to default list view.
- Edit List Item (EditForm.aspx) - Clicking Save or Cancel button redirect to default list view.
- Access List Item (DispForm.aspx) - Clicking Close button redirect to default list view.
But what if you want to redirect the user to the "Home page", custom "Thank you" page or any other page.
Well, there is a simple OOTB (out of the box) solution to achieve this.
This quick solution works for SharePoint Online / SharePoint 2019 / SharePoint 2016 / SharePoint 2013 / SharePoint 2010 / MOSS. Test it in your development environment before implementing for live site.
⭐ Steps to redirect to different page after adding new list items in SharePoint
- Navigate to your SharePoint List / Library.
- Click "New" button from Ribbon to create a new List Item.
- Copy the URL link from address bar in browser.
- Replace the redirection link, everything after "Source=". You may ignore the RootFolder parameter.
- Assume, we have a custom Thank you page created at this location - https://c2c.sharepoint.com/sites/SPDev/SitePages/Thankyou.aspx.
Append this link after "Source=" as below. - Now you can use this link and add it in navigation (Quick Launch, Top Navigation, Quick Links, etc.).
- When user saves a new item using this link, will be redirected to custom thank you page.
It will be in this format -
https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/NewForm.aspx?Source=https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/AllItems.aspx&RootFolder=
The "Source" parameter tells SharePoint where to redirect the user after form submission.https://c2c.sharepoint.com/sites/SPDev/Lists/Projects/NewForm.aspx?Source=https://c2c.sharepoint.com/sites/SPDev/SitePages/Thankyou.aspx
For redirecting to the Home page, simply add sign "/" for Source parameter.
http://sharepointsite/Lists/SPList/NewForm.aspx?Source=/
http://sharepointsite/Lists/SPList/EditForm.aspx?id=1&Source=/
http://sharepointsite/Lists/SPList/DispForm.aspx?id=1&Source=/
You can use this approach for both Modern and Classic SharePoint development - with SPFX custom forms, HTML and JQuery based forms in Content Editor / Script Editor web parts.
Have Questions? Post them here!
- Move Copy Migrate SharePoint OneDrive files folders to different site collection location
- How to generate client id and secret to register SharePoint App with OAuth
- How to share SharePoint site or document with all users in organization
- Get-ADUser PowerShell - Get AD user details using email address
- error CAML Query containing special characters
- Access URL for SharePoint Tenant Admin Center (Online Office 365)
- Fix SharePoint Error - The Managed Metadata Service or Connection is currently not available. The Application Pool or Managed Metadata Web Service may not have been started
- SharePoint - The URL is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
- How to delete SharePoint List Item programmatically using C#.Net
- How to Share Microsoft SharePoint Site with Users or Groups
- JSON column formatting to preview SharePoint Online file on mouse hover
- SharePoint List redirect user after submitting form NewForm.aspx
- See actual SharePoint error exception modify web.config
- SharePoint Server 2016 IT Preview Deprecated Removed features
- How to create SharePoint Document Library
- How to Get or Set SharePoint Document ID _dlc_DocId using PowerShell
- How to disable SharePoint subsite creation option for owners
- PowerShell - How to use Try Catch Finally blocks for error exception handling (Windows/SharePoint)
- SharePoint error - Your organization doesn't allow sharing with users from this domain. Please contact your IT department for help. (OSE403)
- [Solved] SharePoint Search Internal server error exception
- How to wrap column text in SharePoint Online Modern List Grid View using JSON formatting
- How to extend retiring SharePoint 2010 Workflows and continue with Office 365
- Changed AD user display name showing old name in SharePoint
- How to hide or remove quick launch left navigation from SharePoint Online Modern site page
- How to enable anonymous public access for SharePoint Online site collection, file, folder without login ?
- Add HTML to Android Activity or TextView - Android
- Exception in thread main java.nio.file.NoSuchFileException - Java
- Java + Spring JDBC Template + Gradle Example - Java
- 12 August - International Youth Day celebrated worldwide - News
- How to make div or text in html unselectable using CSS - CSS
- Copy file from a remote server to current local directory system using SCP command - HowTos
- Save webpage as pdf in Google Chrome for Mac OS X - Mac-OS-X
- Maven : java.lang.ClassNotFoundException: Xmx512m - Android