Welcome to the LimeSurvey Community Forum

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

URL Attribute in Survey

  • somenewhere
  • somenewhere's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #202526 by somenewhere
URL Attribute in Survey was created by somenewhere
Hello,

I have a question about passing the argument via URL. I use Version 3.22.25+200706 of LimeSurvey :)


One of our users created a survey and add a question (List radio type) code like this:

Code:
Could you tell me something {TOKEN:ATTRIBUTE_2} about this?


Next, she adds attributes (1 and 2), nextly was added Survey participants finally activate the survey.


After a couple of hours of an active survey we observed the problem with responses and find out that problem is with variable passed via URL:

Code:
https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKEN_TO_SURVEY&SURVEY_IDXGROUP_IDXQUESTION_ID=SOME_VALUE

The problem was with SURVEY_IDXGROUP_IDXQUESTION_ID=SOME_VALUE

If we use this notation. Survey accepts only string/number with 5 characters, example:

https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&SURVEY_IDXGROUP_IDXQUESTION_ID=12345

https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&SURVEY_IDXGROUP_IDXQUESTION_ID=ABCDE

If we use a string with more characters this cause a problem:
Code:
500  -> While the webserver was processing the query, an internal error occurred.
 
DevTools says -> Failed to load resource: the server responded with a status of 500 ()


But when I changed the URL and deleted SURVEY_ID and GROUP_ID. The survey works fine.


https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&QUESTION_ID=SOME_VALUE


This is confusing to me because I didn’t find any errors in the server log?


My question is how we should pass variables?

A) https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&SURVEY_IDXGROUP_IDXQUESTION_ID=12345

B) https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&QUESTION_ID=12345

C) https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY (this also works for this survey)

D) Another way?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #202529 by tpartner
Replied by tpartner on topic URL Attribute in Survey
What are you trying to achieve with that URL parameter? You cannot be prefilling a survey question because the parameter is an invalid question code.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • somenewhere
  • somenewhere's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #202530 by somenewhere
Replied by somenewhere on topic URL Attribute in Survey
Good question,

In my opinion, this parameter isn't needed. Lime works fine with those URLs:

https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY&QUESTION_ID=12345

https://SURVEY_URL/index.php/SURVEY_ID?lang=en&token=TOKENTOSURVEY

Just wondering why it works this way. It's bug or future?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #202531 by Joffm
Replied by Joffm on topic URL Attribute in Survey
As you do not want to use panel integration, in my opinion you should use:
Code:
https://path_to_survey/index.php/277471?Param1=2&Param2=abcdefg12345678



Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #202539 by DenisChenu
Replied by DenisChenu on topic URL Attribute in Survey

DevTools says -> Failed to load resource: the server responded with a status of 500 ()

What is your LimeSirvey version?

Since you can set anythiung in value to be prefilled : this muts not send a 500 error (maybe disable the value, but not a 500 error).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • somenewhere
  • somenewhere's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #202554 by somenewhere
Replied by somenewhere on topic URL Attribute in Survey
Version 3.22.25+200706
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #202559 by DenisChenu
Replied by DenisChenu on topic URL Attribute in Survey
Confirm the issue about the 500 : bugs.limesurvey.org/view.php?id=16481

Else : you use a single choice question prefilled value by long string.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • somenewhere
  • somenewhere's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 9 months ago #202566 by somenewhere
Replied by somenewhere on topic URL Attribute in Survey
Understood! Thanks for confirming the bug :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose