Redirect based on condition


Badge +6

Hi Team,

I would like to redirect to different page based on condition after submitting the form.

I tried using redirect url in advanced section of the form settings as below.

fn-if(item property value != "x", "/sites/sitename","sites/sitename/lists/listname")

But if is not getting resolved. I am getting navigated to below url

https://rootsite.com/sites/sitename/

fn-if(item property value != "x", "/sites/sitename","sites/sitename/lists/listname")

I dont understand what wrong i am doing. Please correct me.

Thanks & Regards

Usha


12 replies

Userlevel 5
Badge +14

is it NEW form?

if so, all the item properties are yet empty, so your condition is always true, hence you're always redirected to "/sites/sitename"

Badge +6

Hello Marian,

Yes it is a new form. Thats my problem.

There are actually 2 buttons on the form. When i click 1 button the form should be saved and redirect to 1 URL .

Is another button is clicked form should be saved and redirect to a different url.

I am trying by inserting value in a field in the form connected to list. But that value is returning empty.

can you please suggest how to identify which button is clicked and then redirect based on that?

Thanks & Regards,

Usha

Userlevel 5
Badge +14

you can configure different redirect URL per each button

213656_pastedImage_1.png

Badge +6

I am unable to see this Redirect URL for the button. So i need to do anything to make it visible?

Userlevel 5
Badge +14

what forms version are you on?

it was introduced in v2.10.0.0 in March 2017

see release notes -  

Badge +6

Its 2013 version which we are using

Userlevel 5
Badge +14

go to Form Designer >> Help >> About and you will see there exact version number

Badge +6

Version mention - About Nintex Forms 2.8.1.0

Badge +6

I even tried implementing the way mentioned at  

To implement button click in jquery function on click of javascript button.

It works sometimes. But sometimes it just redirects but doesnt save the form. 

Userlevel 5
Badge +14

so you need to upgrade to get this functionality available

Badge +6

Hi,

i actually found a way to do this. Please share your comments on the implementation.

function MyFunction()

{

NWF$("savebutton").click();

alert("The savebutton was clicked.");

}

from below url

 

I just saved and redirected to the respective url

Thanks 

Usha

Userlevel 5
Badge +14

to be honest, I do not see all these forced aside redirections reliable at all.

note when you make/invoke a click, it's asynchronous event. it in turn runs plenty of other asynchronous events (form recalculations, validations; then form submit; then server response need to be processed with possibly server redirect, etc.)

while these are being processed, you issue your own redirection. it's just a matter of coincidence when exactly this is processed. it might be processed too early and your form is not even submitted. or it might be queue to be processed too late but it will not get chance to be, since server response and/or redirect take place sooner.

Reply