Dynamic Page Redirect

I am looking for the best solution to allow my web app to load a different version based on a parameter in there userprofile that is accessed via a SC Query.

Main users are loading pages in a default way.
For my USA users I need to have them see non-EU formated pages, we built all our pages in two templates ROW and USA.

I would like the auto redirect to send the user to the “/versions/USA/” section if there version value is US.

thanks.

Already a tutorial on conditional redirects.

I am not sure that is what I am looking for as the login to the site does have admin and regular users, I am looking more to show the user the proper page language based on a value in there profile, this is not there access level.

@cchesnet,

What you can do is use this, Redirect when a condition is met

In your server action, after login, do a condition if the profile language is USA, then set value = 1, else set value = 0.

1 Like

That is the concept you need to study, you need to try and understand how workflows work rather than just copying code snippets

Basically the code for you is something like:

browser1.goto(form1.data.query1[0].country == ‘USA’? ‘/versions/USA’: ‘/versions/ROW’)

basically exactly the same conceptually as in that thread

browser1.goto(loginform.data.query1[0].user_role == ‘admin’ ? ‘page1.html’ : ‘page2.html’)

It’s just a conditional statement

1 Like

@Hyperbytes,

Thanks for the insight, I did understand the working process of workflows, I just was not seeing the method to trigger the browser redirect, I not better saw it should be done on the login page and not the post landing page.

Thanks for the clarity.

1 Like