Looking to redirect to the Previous Page after a Sharepoint form submit. People will be coming to this form from different departments and want to redirect based on their previous page.

I see the ?Source=url attribute, but not sure how to implement something like window.history.back();


If users are coming to the form from different locations, then create different URLs for each source. (so, have different urls that each have a different ?Source attribute)

If the URL is part of a global nav, and if users could be on a variety of pages when they click the URL, then javascript would be needed to customize the URL for each page that they're on. Of course, this is far more complex than the first option.

|improve this answer|||||
  • Thanks @Mike2500 thats perfect, works great! Thank you – Doug Clelland Jan 9 '19 at 16:03

If the users are navigating from different location then you need to create the dynamic links on each page.

While creating link to list form, you can add Source query string parameter to generate the dynamic link. Like given belpw:


Where currentPageUrl is the url of the page from where you are navigating to the list form.

In order to do this you will need custom coding(either using plain html or html+javascript).

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.