Form Redirection on Save - Bug?

I notice the result.RedirectURL isn't working for me.
Modern SharePoint Online.
Using Chrome and/or Teams.
Form in webpart and/or panel.

Code runs, checked console.
I do get the desired result with "window.location.href"

fd.spSaved(function(result) {
    //simply replace this URL for redirection:
    result.RedirectUrl = "https://<tenant>.sharepoint.com/sites/StartCardsandSWMS/SitePages/Start-Card-Complete.aspx";
    window.location.href = "https://<tenant>.sharepoint.com/sites/StartCardsandSWMS/SitePages/Start-Card-Complete.aspx"; 
});

Maybe something broke?

Adam

Hello @AdamSmith,

Do you see any errors in the console?

Please try to completely clear the browser cache and try again.

Hello Nikitina,

I have added the below code and it hasn't worked:

//This code will direct users to the Submission Success Landing Page on Save
fd.spSaved(function(result) {
    //Add URl Below
    result.RedirectUrl =
        "https://test-site.com/submissionsuccess.aspx";
});

The code was added outside the fd.spRendered(function(){}) event and inside this event.

Console doesn't display any errors either after submitting the form.

@DryChips,

What version of the Plumsail Designer are you using? How do you open the form: in full screen, panel or from List or Library?

Please test this code and share the screenshot of the console output:

fd.spSaved(function(result) {
    var redirect = result.RedirectUrl;
    result.RedirectUrl = "";
    console.log(result);
    console.log(redirect);
});

image

Hi @mnikitina looks like it does not redirect when used in the webpart. It does redirects if I open it the form from the list. On the site page I'll only receive the submission confirmation.

Hello @aseem,

RedirectUrl is ignored inside a panel. You can redirect users to another page using this code:

 fd.spSaved(function(result) {
    window.location.href = "Page_URL"; 
});