Forums

Redirect to different URL based on input?

motberg 11 Jul, 2019
Hi there guys,

I am wondering if it would be possible to use an input field to redirect to different URLs?
For example, the field would say:

Enter Code
> User enters ABCD and it gets redirected to www.example.com
> User enters 1234 and it gets redirected to www.mydomain.com

And if user enters an incorrect code, they get an error message.

I can't figure out how to do this. I only know how to do a normal redirect to a url 🙄

Anyone who can point me in the right direction? Thanks a million!
healyhatman 11 Jul, 2019
Answer
1 Likes
Use a switch. Let's say you call it switch_redirect

ABCD:www.example.com
1234:www.mydomain.com

In the redirect action, just use {var:switch_redirect}
motberg 15 Jul, 2019
Hi healyhatman,

Thanks for the tip, but I can't get it to work with my limited knowledge. I put in a Switcher Area (under the Design area) with the values that I needed but since I don't really know what I am doing, I put this Switcher Area under my Text Field, which I assume is the place I should put it?



Then I also put into the Setup area a Switch before the Redirect function and it's a no go. I am pretty sure I messed up along the way but I can't figure out where 🤗


Appreciate it very much if you can point me in the right direction?

Thanks so much.
healyhatman 15 Jul, 2019
Nota switcher area, a switch. In events not views
motberg 15 Jul, 2019
Hi healyhatman,

Thanks a bunch! Finally got it to work🙂
This topic is locked and no more replies can be posted.