- Posts: 153
- Thank you received: 8
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Rediriceting to one end URL when an specific answer is chosen
- KompetenzZ
- Topic Author
- Offline
- Premium Member
Less
More
5 years 2 months ago #180224
by KompetenzZ
Cheers kompetenzz
Rediriceting to one end URL when an specific answer is chosen was created by KompetenzZ
Hi community,
when I need to redirect to one of two different End URLs it works according to: www.limesurvey.org/community/forums/can-...ent-end-urls?start=0
But now I would like to redirect only to one End URL: If a specific answer is chosen, the survey should redirect to the URL. If the answer is not chosen, the common end message text (which I typed in there) should be displayed.
I thought this is the right code:
But there is an expression manager error. Is this a bug?
A test survey with the described behaviour is attached.
when I need to redirect to one of two different End URLs it works according to: www.limesurvey.org/community/forums/can-...ent-end-urls?start=0
But now I would like to redirect only to one End URL: If a specific answer is chosen, the survey should redirect to the URL. If the answer is not chosen, the common end message text (which I typed in there) should be displayed.
I thought this is the right code:
Code:
{if(Q2_1 == "Y", equrl1)}
But there is an expression manager error. Is this a bug?
A test survey with the described behaviour is attached.
Cheers kompetenzz
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
5 years 2 months ago #180227
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Rediriceting to one end URL when an specific answer is chosen
You always need to include the result if the condition is false (although I, have not tried this in an End URL).
Code:
{if(Q2_1 == "Y", equrl1 "")}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
5 years 2 months ago - 5 years 2 months ago #180228
by DenisChenu
github.com/LimeSurvey/LimeSurvey/commit/...b1ffe6caffbaae39751c
Else : for endurl : surely the quote issue bugs.limesurvey.org/view.php?id=14113#c50431
Best is to set it in the equation directly
Manual updated : manual.limesurvey.org/index.php?title=Ex...=135017&oldid=133368
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Rediriceting to one end URL when an specific answer is chosen
Not since 3.0.2+180110 (i must update manual)tpartner wrote: You always need to include the result if the condition is false (although I, have not tried this in an End URL).
github.com/LimeSurvey/LimeSurvey/commit/...b1ffe6caffbaae39751c
Else : for endurl : surely the quote issue bugs.limesurvey.org/view.php?id=14113#c50431
Best is to set it in the equation directly
Manual updated : manual.limesurvey.org/index.php?title=Ex...=135017&oldid=133368
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 2 months ago by DenisChenu. Reason: Manual updated
The topic has been locked.
- KompetenzZ
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 153
- Thank you received: 8
5 years 2 months ago #180234
by KompetenzZ
Cheers kompetenzz
Replied by KompetenzZ on topic Rediriceting to one end URL when an specific answer is chosen
Thank you for the quick help,
@tpartner: It would be fair to say:
with the second comma.
Anyway, the if statement in the End URL field seems not to accept double quotes ", I tried it with single quotes ', it worked. Maybe that was your point Denis?
But since I need to be sure I changed my question and End URL statement to:
without any quotes.
If someone needs it, a working test survey is attached.
@tpartner: It would be fair to say:
Code:
{if(Q2_1 == "Y", equrl1, "")}
Anyway, the if statement in the End URL field seems not to accept double quotes ", I tried it with single quotes ', it worked. Maybe that was your point Denis?
But since I need to be sure I changed my question and End URL statement to:
Code:
{if(Q2 == 1, equrl1)}
I always did that.DenisChenu wrote: Best is to set it in the equation directly
If someone needs it, a working test survey is attached.
Cheers kompetenzz
The topic has been locked.