Welcome to the LimeSurvey Community Forum

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

Pass a parameter via URL

  • flink
  • flink's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 4 months ago - 9 years 4 months ago #122066 by flink
Pass a parameter via URL was created by flink
Hello,

I'm trying to pass a parameter to my survey via URL, so that a short text field is prefilled. I tried the following, but it didn't work.

example.com/limesurvey/index.php/761854?name=abc

"name" is the text field’s qcode. What am I doing wrong?

Thanks for your advide!
Last edit: 9 years 4 months ago by DenisChenu. Reason: example.com is done for this
The topic has been locked.
More
9 years 4 months ago - 9 years 4 months ago #122071 by steve_81
Replied by steve_81 on topic Pass a parameter via URL
Hi,

according to the manual: "It's important to add "newtest/Y" to the link" ( www.limesurvey.org/manual/Workarounds:_S...using_the_survey_URL )

Maybe then it works.
example.com/limesurvey/index.php/761854/newtest/Y?name=abc or
example.com/limesurvey/index.php/survey/index/sid/761854/newtest/Y?name=abc

Greets
Stefan
Last edit: 9 years 4 months ago by DenisChenu. Reason: example.com is done for example
The following user(s) said Thank You: flink
The topic has been locked.
  • flink
  • flink's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 4 months ago #122072 by flink
Replied by flink on topic Pass a parameter via URL
Hey Stefan,

thank you very much, it works just as planned! :)

Greets
Benjamin
The topic has been locked.
More
9 years 4 months ago #122260 by mfeher
Replied by mfeher on topic Pass a parameter via URL
This solution is not working for me, I have tried a number of solutions suggested in the workarounds
Survey URL is
myurl.ca/index.php?r=survey/index/sid/123456/lang/en

Survey id = 123456
Question Group ID = 1
Question ID = 20
Question CODE = T0

And I can not seem to locate the Limesurvey Version# to see if it is 1.80, 1.92, 2.0 or other
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 4 months ago #122278 by tpartner
Replied by tpartner on topic Pass a parameter via URL
@mfeher, what question type are you trying to pre-populate?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 4 months ago #122298 by mfeher
Replied by mfeher on topic Pass a parameter via URL
Thank you Tom. The question is Short Answer format. I am populating it with a value from another system, and actually managed to resolve the issue with the format of the URL. I ma

survey.myurl.ca/index.php?r=survey/index...newtest/Y&T0=1234567
or
survey.myurl.ca/index.php?r=survey/index...Y&12345X1X20=1234567

Thank you to Denis who assisted

I added the full URL into an email template which is sent automatically based on specific criteria as follows:

survey.myurl.ca/index.php?r=survey/index...ewtest/Y&12345X1X20= [token]sytem_table_field_name[\token]
The topic has been locked.
More
9 years 3 months ago #122523 by potvorko
Replied by potvorko on topic Pass a parameter via URL
Hi. I have the same problem, and tried all the solutions suggested here, as well as those on the "lime survey manual", without any results.

My one field survey running on limeservice:

potvorko.limequery.com/index.php/183169/lang-en

I want to pre-fill the one short-answer question with some value passed through the URL:

The question's SGQA id is: 183169X2X5. The code is: Q1. It sits in a Question Group with code: QG1

I tried many combinations of the url including these ones, with no luck:
potvorko.limequery.com/index.php?r=surve...Y&183169X2X5=twonine
potvorko.limequery.com/index.php/183169/...Q1=twonine&newtest=Y

Any ideas?

thanks.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
9 years 3 months ago #122527 by DenisChenu
Replied by DenisChenu on topic Pass a parameter via URL

potvorko wrote: ....
potvorko.limequery.com/index.php?r=surve...Y&183169X2X5=twonine
potvorko.limequery.com/index.php/183169/...Q1=twonine&newtest=Y
....

I'm not sure, but try to deactivate "Captcha", i think it can break prefilling url

After
index.php/183169/lang-en?Q1=twonine&newtest=Y
index.php/183169/lang-en?183169X2X5=twonine&newtest=Y

Must do the trick

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
9 years 3 months ago #122554 by potvorko
Replied by potvorko on topic Pass a parameter via URL
Yes, deactivating the captcha, front-page, and token authentication makes the URL parameter passing work.
But I would like to continue to filter robots and non-authentic users, and still be able to pass URL parameters.
Any way to have Captcha be enabled at the end of the session, after pressing the send/save button, for example? Or any other suggestions?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
9 years 3 months ago #122559 by DenisChenu
Replied by DenisChenu on topic Pass a parameter via URL
Hi,

I never have robots without Captcha, i don't understand why robits come click on next, click on next X times ???

But actually : if you need Captcha + URL param : make a bug report ....

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
9 years 3 months ago #122560 by potvorko
Replied by potvorko on topic Pass a parameter via URL
Not helpful. And very cryptic (what does "i never have robots without Captcha" mean?). Anyway, this is not a bug, but if you want to report it as such, go for it.

Anyone else with suggestions or examples on how URL param passing can work with authenticated users?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
9 years 3 months ago #122562 by DenisChenu
Replied by DenisChenu on topic Pass a parameter via URL
I never have robots without Captcha mean : on any of mine survey OR client survey have "robots", i never use Captcha in any survey i manage.

authenticated users => Use token www.limesurvey.org/manual/Tokens , and use Attribute for managing information.

Denis
PS: i don't report bug if i don't need it . Sometimes, i fix bug i report or another user report. I think you can report it as bug. If you don't want to report : no problem for me ....

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose