Redirect
Description:
The most common URL type is what we call "Parameter based". This structure has a "base URL", followed by a "?" (question mark), followed by one or more pairs of parameters that have a "name" and "value" separated by "=" (equal sign). Each pair, in turn, is separated by a "&" (ampersand sign).
The other not-so-common type is what we called "Path-based". This structure just have a series of values, separated by "/" (slashes). This type should not have any special symbols like "?", "&", or "=" as part of the URL.
Finally, there also exists some "Hybrid based" structures, that do not adhere to the common ones. These are quite rare.
Parameter based:
With the "redirect" script you can send respondents to any such URL.
Using this script it is very important to remember that there should be NONE of the special symbols used to create the URL, like the "?", "&" and "=". These are ALL inserted at appropriate places by the script.
Survey Design: script:redirect(baseurl,p1,v1,p2,v2,p3,v3........)
Parameters:
Where p1 = parameter1 and v1 = value1, etc.
Example:
Survey Design: script:redirect('https://yourlink.com','survey','XYZ123')
You can also use the short URL as baseURL. You only need to add extra parameters if you have extra parameters you want to use. No need to add the qif and qsid paremeters in that case.
This will result in the following link: "https://yourlink.com?survey=XYZ123"
Path-based:
Using the "concat" script, you can create any such URL. Just remember to include all "/" at appropriate places, e.g. if some if the parts are fetched from e.g. captured values or from the original link.
script:concat('\https://yourlink.com/',\surveyid.a,'/',\status.a) will result in a link like: "https://yourlink.com/XYZ123/Complete", assuming that question "\surveyid" contains the value "XYZ123" and that question "\status" contains the value "Complete"
Rember that no parameters should contain any of "&", "?" or "=".
Hybrid based:
This is quite rare, but to handle such URL's, we have the "concatx" script. This allows for the following placeholders to be used, in order to insert "?", "&" and "=" at appropriate places:
Placeholder | Replacement character |
_AND_SIGN_ | & |
_QUES_SIGN_ | ? |
_EQUAL_SIGN_ | = |
This way you can build hybrid URLS, like:
script:concatx('https://yourlink.com/',\Question1.a,'_EQUAL_SIGN_',\Question2.a,'/someDeeperPath/','status,'_EQUAL_SIGN_','Complete') will genarate an URL like this:
https://yourlink.com/ABC123XYZ=123/someDeeperPath/status=Complete
Assuming "\Question1" contains the value "ABC123XYZ" and "\Question2" the value "123".