Redirect user after inserting or editing a list item

When you are using lists and want users to enter new items into that list, you might want to send them to a different location after the Save operation. For example,¬† you want your users to know that the save has been successful. A redirect after saving a new item or editing an existing item can come in handy. In this blog I’ll show you how to set up a redirect after saving a form.

First a little background info on the way list items are inserted into a list. Each list has 3 forms to view, create and edit items:

  • dispform.aspx – View an item
  • newform.aspx – Create an item
  • editform.aspx – Edit an item

The location of these forms is as follows, where you have to replace form.aspx with one of the above mentioned options:
http(s)://yoursharepointurl/yoursite/Lists/yourlist/form.aspx

You can set a save redirect for both the newform(.aspx) and editform(.aspx) forms. The redirect is not possible for dispform(.aspx) however, as this form is only meant to view an item. Therefore it does not need a save button.

Sending users to a different location after the save operation is not difficult to set up at all. You’ll just have to send your users to the right newform or editform URL to begin with. The right URL is the newform or dispform URL with suffix¬†?Source=yoururl, in which you’ll have to replace yoururl with the preferred redirection URL. For example: http(s)://yoursharepointurl/yoursite/Lists/yourlist/newform.aspx?Source=https://yoursharepointurl/anothersite redirects the user to https://yoursharepointurl/anothersite after saving the newform on yourlist.

Read the following blog to learn how to redirect your users after canceling their list input.

Redirect users after cancelling their list input

Leave a Reply

Your email address will not be published. Required fields are marked *