Redirect to static page basen on field value

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Cloud.Ed
Posts: 40
Joined: Fri Dec 04, 2015

11 Jan 2018

We are happy with the default redirects and the ability to redirect to the edit form after creation of a new form. Next, we want to, on save, test a field value and based on that value redirect to different lists view, a static URL. I hope that makes sense.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

11 Jan 2018

Sure, just modify the snippet below accordingly to your needs:

Code: Select all

fd.onsubmit(function() {
    if (fd.field('Field1').value() == 'XXX') {
        // if the Field1 is set to 'XXX', redirect users to URL1 after saving;
        fd.sourceFormParam('URL1');
    } else {
        // redirect users to URL2 otherwise;
        fd.sourceFormParam('URL2');
    }
    
    return true;
})

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests