Redirect to one of two different end URLs

More
2 years 4 months ago #139057 by wshead
wshead created the topic: Redirect to one of two different end URLs
I would like to automatically redirect participants at the end of my survey to one of two different URLs, depending on their answers to questions in the survey. Is this possible?

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #139059 by tpartner
tpartner replied the topic: Redirect to one of two different end URLs
Yes, you can use Expression Manager to pipe in the appropriate URL.

It may be easiest to place the URLs in separate equation type questions, then your end URL could be an expression like:

{if(q1 == 1, equation1, equation2)}

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: wshead

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #139060 by wshead
wshead replied the topic: Redirect to one of two different end URLs
Thank you for your help and prompt reply, Tony.

I"m very much a beginner when it comes to this stuff. I'm not sure what you mean by "separate equation type questions." Perhaps you could provide a quick model of what exactly would be entered into the "End URL" box under General Settings with the following parameters:
Answer to q1 = 1, end URL is abc.com
Answer to q1 = 2, end URL is xyz.com

Thanks again.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #139064 by holch
holch replied the topic: Redirect to one of two different end URLs
He provided it already. Create two equation questions, in equation1 you put the url abc.com, in the second one you put the URL xyz.com.

Then use the code Tpartner was giving in the End URL field. It will check if the code is 1, then it will use the content of equation1 and if not it will use the value of equation2.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
The following user(s) said Thank You: tpartner, wshead

Please Log in or Create an account to join the conversation.

More
2 years 3 months ago #139225 by wshead
wshead replied the topic: Redirect to one of two different end URLs
Thank you. As I mentioned I'm very much a beginner at LS. To give you an idea it took me a while to figure out that I was supposed to simply enter the URL into the question field of the equation question (I thought I needed to enter an actual equation with = symbols and such).

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago - 2 years 3 weeks ago #143412 by nique
nique replied the topic: Redirect to one of two different end URLs
Apologies for posting to an old post but this works perfectly for me except I am struggling with EM.

How would I adjust the IF statement for 4 equations?

If 1 - Web A, if 2 - Web B, if 3 - Web C, if 3 - Web D.

I have this but it does not seem to be working - if(A1 == 1, equation1, if(A1 == 2, equation2, if(A1 == 3, equation3, if(A1 == 4, equation4))))

Thank you.
Last Edit: 2 years 3 weeks ago by nique.

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #143422 by Ben_V
Ben_V replied the topic: Redirect to one of two different end URLs
Try something around:
{if(A1 == 1, equation1, if(A1 == 2, equation2, if(A1 == 3, equation3, equation4)))}

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: nique

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago #143458 by nique
nique replied the topic: Redirect to one of two different end URLs
EM will be the death of me.

THANK YOU!

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago - 2 years 3 weeks ago #143475 by Ben_V
Ben_V replied the topic: Redirect to one of two different end URLs

nique wrote: EM will be the death of me.


Em don't use a strict " if -> else if -> else " syntax but it's pretty the same and easier than you can expect...

equation1 = if statement
equation2 = else if statement
equation3 = else if statement
equation4 = else statement

Remember that there are buttons (at survey/group/question level) to check your EM syntax
For more complex equations, you can use some line break for more readability ;)
{
    if (A1 == 1, equation1,
        if (A1 == 2, equation2,
            if (A1 == 3, equation3, equation4)))
}

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last Edit: 2 years 3 weeks ago by Ben_V.

Please Log in or Create an account to join the conversation.

More
2 years 3 weeks ago - 2 years 3 weeks ago #143476 by tpartner
tpartner replied the topic: Redirect to one of two different end URLs
Yes, Expression Manager uses the Excel format for IF() statements:

if(condition, 'Returned if true', 'Returned if false (can be another IF() statement)')

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 3 weeks ago by tpartner.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago - 1 year 7 months ago #151914 by JaredStapleton
JaredStapleton replied the topic: Redirect to one of two different end URLs
For any other beginners who stumble here- don't forget the "redirect automatically" setting under Presentation and Navigation, and for me I had to activate the survey before the redirection would work. Otherwise you just see the url on the end page as a link.
Last Edit: 1 year 7 months ago by JaredStapleton.

Please Log in or Create an account to join the conversation.

More
1 week 3 days ago #176261 by surveySn
surveySn replied the topic: Redirect to one of two different end URLs
Hi tpartner,I have tried many times, but failed, can you make a LSS?

Thanks very much.

Please Log in or Create an account to join the conversation.

More
1 week 3 days ago #176265 by surveySn
surveySn replied the topic: Redirect to one of two different end URLs
I will. I forgot to add http://

Please Log in or Create an account to join the conversation.

More
1 week 17 hours ago #176282 by holch
holch replied the topic: Redirect to one of two different end URLs

can you make a LSS?

How about you providing a LSS file showing what you have tried? Makes a lot more sense.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!