Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Dynamic value passed to external URL?

Dynamic value passed to external URL? 1 Jahr 9 Monate her #89951

  • lime_do
  • lime_dos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #89965

  • tpartner
  • tpartners Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 4193
  • Dank erhalten: 788
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #90369

  • lime_do
  • lime_dos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #90373

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2675
  • Dank erhalten: 323
  • Karma: 121
There is only ONE "endpage" in Limesurvey. So are you working with quota? How to do create various endpages in Limesurvey?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #90374

  • lime_do
  • lime_dos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #90388

  • pcmiss
  • pcmisss Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 2
  • Dank erhalten: 1
  • Karma: 0
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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: lime_do

Re: Dynamic value passed to external URL? 1 Jahr 9 Monate her #90431

  • lime_do
  • lime_dos Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 4
  • Karma: 0
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!
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Dynamic value passed to external URL? 1 Jahr 8 Monate her #90438

  • tpartner
  • tpartners Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 4193
  • Dank erhalten: 788
  • Karma: 359
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:
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)
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:
limesurvey.com/endpage?endurl={urlParam}


Here is a sample survey:

Dateianhang:

Dateiname: limesurvey_survey_674191.lss
Dateigröße: 21 KB
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.261 Sekunden
Donation Image