Actions

URL fields: Difference between revisions

From LimeSurvey Manual

No edit summary
(Marked this version for translation)
Line 1: Line 1:
<languages />
<languages />
<translate>
<translate>
<!--T:1-->
__TOC__
__TOC__


==General==
==General== <!--T:2-->


<!--T:3-->
At the end of a survey, or when a quota causes a survey to terminate, there is the option of setting a URL. This URL is presented to the participant who has finished the survey on the completed page, or you can optionally set the participant to be automatically redirected to the URL.
At the end of a survey, or when a quota causes a survey to terminate, there is the option of setting a URL. This URL is presented to the participant who has finished the survey on the completed page, or you can optionally set the participant to be automatically redirected to the URL.


<!--T:4-->
There are a number of fields available to be used to enhance the functionality of this URL.
There are a number of fields available to be used to enhance the functionality of this URL.


===Basic fields===
===Basic fields=== <!--T:5-->


<!--T:6-->
You can use {SAVEDID}, {TOKEN}, {SID} and {LANG} (since 1.71+) in this URL.
You can use {SAVEDID}, {TOKEN}, {SID} and {LANG} (since 1.71+) in this URL.
* SAVEDID is the id assigned to this particular submission,
* SAVEDID is the id assigned to this particular submission,
Line 17: Line 21:
* LANG is the language code
* LANG is the language code


<!--T:7-->
'''Example'''
'''Example'''


<!--T:8-->
http://www.limesurvey.org/test.php?var1={SAVEDID}&var2;={TOKEN}&var3;={SID}&lang;={LANG} (external link)
http://www.limesurvey.org/test.php?var1={SAVEDID}&var2;={TOKEN}&var3;={SID}&lang;={LANG} (external link)


===Answer fields===
===Answer fields=== <!--T:9-->


<!--T:10-->
You can also use {INSERTANS:SGQA} in this URL (since 1.82+).
You can also use {INSERTANS:SGQA} in this URL (since 1.82+).
* {INSERTANS: SGQA} allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey).
* {INSERTANS: SGQA} allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey).


<!--T:11-->
'''Example'''
'''Example'''


<!--T:12-->
"http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}"
"http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}"


===Expressions===
===Expressions=== <!--T:13-->


<!--T:14-->
You can also use any Expression Manager expression (since 1.92+).
You can also use any Expression Manager expression (since 1.92+).


<!--T:15-->
'''Example'''
'''Example'''


<!--T:16-->
"http://www.limesurvey.org/test.php?gender={if(sex=='Male','M','F')}&name;={name}
"http://www.limesurvey.org/test.php?gender={if(sex=='Male','M','F')}&name;={name}


===Passthrough fields (LimeSurvey 2.x or later)===
===Passthrough fields (LimeSurvey 2.x or later)=== <!--T:17-->


<!--T:18-->
Starting with version 2.0 you now have to define any additional parameters that should be passed to the end URL in the survey settings (Tab "Panel integration"). To use such a parameter in the end URL just insert the tag {PASSTHRU:<paramname>} where <paramname> is the name of your input parameter.
Starting with version 2.0 you now have to define any additional parameters that should be passed to the end URL in the survey settings (Tab "Panel integration"). To use such a parameter in the end URL just insert the tag {PASSTHRU:<paramname>} where <paramname> is the name of your input parameter.


<!--T:19-->
Example:
Example:


<!--T:20-->
You defined in the Panel integration tab a parameter named 'foobar'. The survey is started with a link like
You defined in the Panel integration tab a parameter named 'foobar'. The survey is started with a link like


<!--T:21-->
  http://localhost/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123
  http://localhost/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123


<!--T:22-->
where XYZ123 is the value you want to pass.
where XYZ123 is the value you want to pass.


<!--T:23-->
A survey end URL of "http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}" would then convert to "http://www.limesurvey.org/test.php?foobarout=XYZ123"
A survey end URL of "http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}" would then convert to "http://www.limesurvey.org/test.php?foobarout=XYZ123"


===Passthrough fields (LimeSurvey 1.92 and older)===
===Passthrough fields (LimeSurvey 1.92 and older)=== <!--T:24-->


<!--T:25-->
You can also use a 'passthrough' field name and data value in the end URL.
You can also use a 'passthrough' field name and data value in the end URL.


<!--T:26-->
In some instances you may want to pass a value to the survey at initialization, and then have that value passed through to an external script at the end (for example a marketing firms subsid).
In some instances you may want to pass a value to the survey at initialization, and then have that value passed through to an external script at the end (for example a marketing firms subsid).


<!--T:27-->
'''Example'''
'''Example'''


<!--T:28-->
In this case you'd start the survey with the query url "index.php?sid=12345&passthru;=subsid&subsid;=9999".
In this case you'd start the survey with the query url "index.php?sid=12345&passthru;=subsid&subsid;=9999".


<!--T:29-->
In your URL you would use {PASSTHRULABEL} and {PASSTHRUVALUE} to reuse these values at the end of the survey.
In your URL you would use {PASSTHRULABEL} and {PASSTHRUVALUE} to reuse these values at the end of the survey.


<!--T:30-->
A URL of "http://www.limesurvey.org/test.php?{PASSTHRULABEL}={PASSTHRUVALUE}" would then convert to "http://www.limesurvey.org/test.php?subsid=9999"
A URL of "http://www.limesurvey.org/test.php?{PASSTHRULABEL}={PASSTHRUVALUE}" would then convert to "http://www.limesurvey.org/test.php?subsid=9999"


===Places to use URL fields===
===Places to use URL fields=== <!--T:31-->


<!--T:32-->
URL fields can be used in the general survey exit URL (see [[Creating a new survey]] ), and in the URL setting for each individual quota (see [[Quotas]] ).
URL fields can be used in the general survey exit URL (see [[Creating a new survey]] ), and in the URL setting for each individual quota (see [[Quotas]] ).
</translate>
</translate>

Revision as of 00:16, 7 June 2013

General

At the end of a survey, or when a quota causes a survey to terminate, there is the option of setting a URL. This URL is presented to the participant who has finished the survey on the completed page, or you can optionally set the participant to be automatically redirected to the URL.

There are a number of fields available to be used to enhance the functionality of this URL.

Basic fields

You can use {SAVEDID}, {TOKEN}, {SID} and {LANG} (since 1.71+) in this URL.

  • SAVEDID is the id assigned to this particular submission,
  • TOKEN is the token used to participate in the survey,
  • SID is the survey ID, and
  • LANG is the language code

Example

http://www.limesurvey.org/test.php?var1={SAVEDID}&var2;={TOKEN}&var3;={SID}⟨={LANG} (external link)

Answer fields

You can also use {INSERTANS:SGQA} in this URL (since 1.82+).

  • {INSERTANS: SGQA} allows adding the response to a specific question in the survey to the final url. This can be useful for sending a response to an external script (ie an email address collected during the survey).

Example

"http://www.limesurvey.org/test.php?email={INSERTANS:1234X56X7}"

Expressions

You can also use any Expression Manager expression (since 1.92+).

Example

"http://www.limesurvey.org/test.php?gender={if(sex=='Male','M','F')}&name;={name}

Passthrough fields (LimeSurvey 2.x or later)

Starting with version 2.0 you now have to define any additional parameters that should be passed to the end URL in the survey settings (Tab "Panel integration"). To use such a parameter in the end URL just insert the tag {PASSTHRU:<paramname>} where <paramname> is the name of your input parameter.

Example:

You defined in the Panel integration tab a parameter named 'foobar'. The survey is started with a link like

  http://localhost/limesurvey/index.php/survey/index/sid/12345/lang/eb?foobar=XYZ123

where XYZ123 is the value you want to pass.

A survey end URL of "http://www.limesurvey.org/test.php?foobarout={PASSTHRU:foobar}" would then convert to "http://www.limesurvey.org/test.php?foobarout=XYZ123"

Passthrough fields (LimeSurvey 1.92 and older)

You can also use a 'passthrough' field name and data value in the end URL.

In some instances you may want to pass a value to the survey at initialization, and then have that value passed through to an external script at the end (for example a marketing firms subsid).

Example

In this case you'd start the survey with the query url "index.php?sid=12345&passthru;=subsid&subsid;=9999".

In your URL you would use {PASSTHRULABEL} and {PASSTHRUVALUE} to reuse these values at the end of the survey.

A URL of "http://www.limesurvey.org/test.php?{PASSTHRULABEL}={PASSTHRUVALUE}" would then convert to "http://www.limesurvey.org/test.php?subsid=9999"

Places to use URL fields

URL fields can be used in the general survey exit URL (see Creating a new survey ), and in the URL setting for each individual quota (see Quotas ).