Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Can I pass a parameter to a survey through a query string?

Can I pass a parameter to a survey through a query string? 4 years 10 months ago #73242

  • eadamuk
  • eadamuk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Hi All,

I'm trying to use limesurvey as a simple job application site. I'd like to create one application form, but pass to it a variable in the query string when it first loads stating which job they are applying for- perhaps displaying that at the top of the form, and then passing it through with the results at the end.

Thanks,
Adam
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 10 months ago #73244

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5430
  • Thank you received: 809
  • Karma: 240
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.
The following user(s) said Thank You: eadamuk

Can I pass a parameter to a survey through a query string? 4 years 10 months ago #73259

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
If you are able to manipulate the link leading to the survey, you can pas that information into a hidden question by URL (as linked above). If the question is placed at the first page of the survey, you can then use SGQA identifier at following questions/headlines to refer to that string.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.
The following user(s) said Thank You: eadamuk

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74560

  • eadamuk
  • eadamuk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
I'm having trouble getting this working. I've followed the instructions in the wiki but it doesn't seem to be pre-populating the results.

The URL I am calling is:
index.php?sid=84938&lang=en&84938X20X207=BL0001&84938X20X208=Head%20Dean%20(Principal)

My survey ID is 84938, question group 20, questions 207 and 208 which are a short free text type.

I assume I can pass strings to a text box, do I need to implement something else on the page?

Thanks
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74574

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
Please post a link to the survey so we can check if you use the correct SGQA IDs.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74816

  • eadamuk
  • eadamuk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Here is the URL link - i just have one page at the moment:
apply.belovedccs.org/index.php?sid=84938...20Dean%20(Principal)

Thanks,
Adam
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74817

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 84
  • Karma: 37
Above and beyond any possible SGQA issues, there was a bug in 1.92 RC4 related to hidden parameters. It has been fixed. Details here: bugs.limesurvey.org/view.php?id=5818
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74818

  • eadamuk
  • eadamuk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Thanks, I'm currently on Version 1.91+ Build 11379 - so I assume this isn't an issue.
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74844

  • tpartner
  • tpartner's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 6571
  • Thank you received: 1477
  • Karma: 579
eadamuk, your survey is pre-populating correctly for me:

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74849

  • holch
  • holch's Avatar
  • Online
  • LimeSurvey Team
  • Posts: 5430
  • Thank you received: 809
  • Karma: 240
Same here. Just like in Tony's screenshot.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74855

  • eadamuk
  • eadamuk's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Thank you!

I guess its an issue with my PC again. For some reason on this computer, and occasionally my work one I cannot see the survey's, or edit the templates.

I've contacted my ISP about the PHP security level, and they assure me that's not the issue, but that's the only thing I can think of as to my certain functionality is working on one PC and not another. Some sort of PHP security/firewall issue thats upset when I try and do certain admin commands and locks me out.

Has anyone come across similar issues? Should I be asking certain questions from my ISP?
The administrator has disabled public write access.

Can I pass a parameter to a survey through a query string? 4 years 9 months ago #74918

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6029
  • Thank you received: 373
  • Karma: 260
eadamuk wrote:
I've contacted my ISP about the PHP security level, and they assure me that's not the issue, but that's the only thing I can think of as to my certain functionality is working on one PC and not another. Some sort of PHP security/firewall issue thats upset when I try and do certain admin commands and locks me out.

Has anyone come across similar issues? Should I be asking certain questions from my ISP?
Please upload a phpinfo file so we can take a look at your server configuration. Just put the following code into a file named phpinfo.php and upload it to your webserver:
< ?php phpinfo(); ? >
(Delete the spaces next to </> when copying the code.)
After uploading please post the link to the file.

Please create a new topic for different problems in the future!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The administrator has disabled public write access.
Time to create page: 1.697 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form