Why cannot redirect to another page after saving in SharePoint List?

Leung1975 296 Reputation points
2023-02-09T13:52:18.8133333+00:00

after user save SharePoint Online List item Both in New form and Edit form, I want to redirect to a calendar instead of allitems.aspx. I tried do it as suggested from the community,

Navigate to SharePoint List

Click "New" button from Ribbon to create a new List Item

Copy the URL link from address bar in browser

It supposed to 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

Replace the redirection link, everything after "Source="

My problem is, the URL that I copied from my list does not include Source=,

It looks like

http://<site>/Lists/<list>/AllItems.aspx

Or end with:

viewid=

PageType=8&ListId=

Something wrong with above approach? Thanks

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
{count} votes

Accepted answer
  1. S D Andrews 226 Reputation points Volunteer Moderator
    2023-02-13T15:02:43.03+00:00

    I'm not sure how much success you'll get with url parameters. To me the issue is that modern SharePoint (unlike Classic) doesn't allow you to tap into event-handlers or add JS to the various Form.aspx pages to achieve things like this. Before I get into a more complex solution I'm wondering if a tweak to the suggestion @Xyza Xue_MSFT offered might work.

    You could, under list settings, toggle the list security setting that permits users to see only their own submitted items. This, along with a calendar view as default might work?

    More complex solutions might involve the PowerPlatform or somehow embedding the Edit.Form.aspx into a page and using JS from there.


1 additional answer

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2023-02-13T08:03:12.12+00:00

    Hi @Leung1975,

    I understand that you have created a calendar view and set Created by is equal to Me. Implemented the calendar view only show items created by the user themselves.

    Your current requirement is: when each user submits their own new items or edits items to the calendar view list, the returned page is the calendar view1 instead of all items.aspx?

    Please set calendar view1 as default view in the view settings: List setting->Edit view->Make this the dafault view

    User's image

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.