Redirect when a condition is met

Hi,
How can I redirect a user to another page when a condition is met (at “steps” level)? I used “redirect” which is in “core action” but it does not work.

Redirect is a server redirect, not a browser redirect so only happens internally within the server, it is for calling server actions from another server action.You need to do the redirect via the browser component using browser1.goto() from within a server Connect dynamic Event on your app connect page

So send a return code via Set value, lets call it ‘return_action’ (output enabled), say with values 1 or 2
The in App connect, success event use something like

browser1.goto(return_action == 1 ? 'page1.php' : 'page2.php')
1 Like

Thanks for your reply.
Redirection is only going to page 2 (second condition) even if this is the first condition that applies.

What’s your expressions exactly, as it seems to be cut off the screenshot?

MailStatut.goto(status==1?‘page1.php’:‘page2.php’)

Where is that ‘status’ coming from? In your server action it’s called differently.

Select it from the dynamic data picker!
Expand the data under your server action and select it there.

That’s the wrong expression. The ‘status’ returns the server action status (i.e. 200, 500 etc)
You need to look for your setvalue steps under DATA.

I changed as following:
goTo.goto(VerifStatut.data.emailStatut==1?‘page1.php’:‘page2.php’)

It’s working now.
goTo.goto(VerifStatut.data.emailStatut==1?‘page1.php’:‘page2.php’).
Thanks

2 Likes