Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Dynamic value passed to external URL?

  • lime_do
  • lime_do's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #89951 by lime_do
Dynamic value passed to external URL? was created by lime_do
Hello,

through a questionnaire, the user should go to different end sides. For example: end1, end2, end3, end4 and so on. The end is to be transferred to an external URL as a parameter. How can we do this? Is it possible to pass a dynamic value to an external application?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago #89965 by tpartner
Replied by tpartner on topic Dynamic value passed to external URL?
You can use Expression Manager to store the parameter in an equation question and then insert it into the End URL - docs.limesurvey.org/Creating+a+new+survey#General .

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • lime_do
  • lime_do's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #90369 by lime_do
Replied by lime_do on topic Dynamic value passed to external URL?
Hello,

thank you for your reply. Can you send me an example? We have created such a question. We are unfortunately not clear how we set a variable to a certain value in Limesurey. The value should be set only when you reach a certain answer.

Example: Several questions lead to the end page "1" and another way ends to page "2". Now, the end page 1 should set in the backgroud the variable "end" to "1" and the end page 2 should set the variable "end" to "2".

Is there already a sample survey? Can you give us a hint?

thank you
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago #90373 by holch
Replied by holch on topic Dynamic value passed to external URL?
There is only ONE "endpage" in Limesurvey. So are you working with quota? How to do create various endpages in Limesurvey?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • lime_do
  • lime_do's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #90374 by lime_do
Replied by lime_do on topic Dynamic value passed to external URL?
We like to create different ways for the user. Depanding on the way, every user comes to the same endpage. The page before should set the variable end=way1 or end=way2.
The topic has been locked.
More
11 years 3 months ago #90388 by pcmiss
Replied by pcmiss on topic Dynamic value passed to external URL?
Hi lime_do

How are you deciding which end page people are sent to? Is it random or is it based on the answer they give to a certain question?

If it were random you could create an equation question with a random number generator

e.g. {rand(1,2)}

Your end URL could then be limesurvey.com/endpage{INSERTANS:45338X359X2628}.html (remember to change the INSERTANS code to whatever the appropriate question code is)

That would send people to either endpage1.html or endpage2.html depending on the random number that was generated.

You can use the same principle if you're not using random numbers by inserting the answer into the endurl. Just make sure that all possible answers to the question have a corresponding html page (e.g. endpageyes.html and endpageno.html) or whatever.

Does that make sense?
The following user(s) said Thank You: lime_do
The topic has been locked.
  • lime_do
  • lime_do's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 3 months ago #90431 by lime_do
Replied by lime_do on topic Dynamic value passed to external URL?
Hi pcmiss,

thank you for your answer. We already figured that out, but our survey might need a bit more logic in it. I attached a logic tree so you can see what our kind of is.

The user runs through the survey and can reach e.g. four different end points, depending on which answers he gave during the survey itself.

My idea would be to write a var into the four last questions and then forward it to the end url, so the endurl would look like:

limesurvey.com/endpage?lastquestion=5a

Of course we could use the INSERTANS method, but then we would have to write something like this:

limesurvey.com/endpage?endurl1={INSERTANS:45338X359X8}&endurl2={INSERTANS:45338X359X9}&endurl3={INSERTANS:45338X359X9}&endurl4={INSERTANS:45338X359X10}.html

what then would result in something like this, if the user ends at Question 5c:

limesurvey.com/endpage?endurl1=&endurl2&$endurl3=var&endurl4=

what would work out, but is not quite a clean solution.

do you have any idea how we can do that? maybe we need a final equation where the var is parsed to after answering the last key question?

thanks!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 3 months ago #90438 by tpartner
Replied by tpartner on topic Dynamic value passed to external URL?
You can use an equation question to store the value of the URL parameter.

For purposes of this example:
- The question codes for the last questions are q_5a, q_5b, q_5c, q_5d
- Those questions are select-radio type

1) Create an equation question on the last page with question code "urlParam" and the following equation:
Code:
if(count(q_5a.NAOK) > 0, '5a', if(count(q_5b.NAOK) > 0, '5b', if(count(q_5c.NAOK) > 0, '5c', if(count(q_5d.NAOK) > 0, '5d', 'defaultValue') )))
(here it is with line-breaks and indents to make it easier to read)
Code:
if(count(q_5a.NAOK) > 0,
  '5a',
  if(count(q_5b.NAOK) > 0,
    '5b',
    if(count(q_5c.NAOK) > 0,
      '5c',
      if(count(q_5d.NAOK) > 0,
        '5d',
        'defaultValue'
      ) 
    ) 
  )
)

2) Use this as the end URL:
Code:
limesurvey.com/endpage?endurl={urlParam}


Here is a sample survey:

File Attachment:

File Name: limesurvey...4191.lss
File Size:21 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose