Welcome to the LimeSurvey Community Forum

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

Pass a parameter via URL

More
10 years 2 months ago - 10 years 2 months ago #122066 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: 10 years 2 months ago by DenisChenu. Reason: example.com is done for this
The topic has been locked.
More
10 years 2 months ago - 10 years 2 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: 10 years 2 months ago by DenisChenu. Reason: example.com is done for example
The following user(s) said Thank You: flink
The topic has been locked.
More
10 years 2 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
10 years 2 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.
More
10 years 2 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
10 years 2 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
10 years 2 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.
More
10 years 2 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
10 years 2 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.
More
10 years 2 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
10 years 2 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.
More
10 years 2 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.
More
10 years 2 months ago #122563 by potvorko
Replied by potvorko on topic Pass a parameter via URL
still confusing and cryptic. But here's something to think about: Just because you don't believe in Captcha, doesn't mean robots don't exist.

Also, as i said before, with token authentication, URL parameter passing doesn't work. The reason it doesn't work is for the same reason that it doesn't work when there is a captcha or an introduction page between the URL send and the actual survey form loading.
The topic has been locked.
More
10 years 2 months ago #122567 by Mazi
Replied by Mazi on topic Pass a parameter via URL
potvorko,

1. Please add your findings at www.limesurvey.org/manual/Workarounds:_S...using_the_survey_URL so other benefit from your solution as well.

2. Furthermore, please also create a bug report and post the link here afterwards so we can try to fix the captcha issue.

3. From my exprience with > 100 Limesurvey projects each year you don't really need captchas. So far I have never seen any robot filling out a survey. They are not that clever.

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose