Welcome to the LimeSurvey Community Forum

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

Prefill URL and Array Question

  • boshra.m
  • boshra.m's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 11 months ago - 2 years 11 months ago #225462 by boshra.m
Prefill URL and Array Question was created by boshra.m
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Cloud Version 5.2.13
Own server or LimeSurvey hosting:
Survey theme/template: 
==================
Hello! 

I am using an array style question and I wanted to prefill using an URL. Can someone please tell me if I am doing this correctly? Also, can I test this using a survey preview or do I have to activate the survey?

example.limesurvey.net/751688/newtest/Y?...3485SQ1/SQ2_A1/A2/A3

SURVEY ID: 751688
Group ID: 52
Question ID: 3485
Subquestion Codes: SQ1 and SQ2
Answers: A1, A2, A3
URL: example.limesurvey.net/
 
Last edit: 2 years 11 months ago by boshra.m.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago - 2 years 11 months ago #225463 by Joffm
Replied by Joffm on topic Prefill URL and Array Question
Hi,
1. No.
See here (the first and second example)
[url] www.limesurvey.org/manual/URL_fields/en#...using_GET_parameters [/url]
If it is an array question, not array(numbers) nor array(text)
As you see here
[url] www.limesurvey.org/manual/ExpressionScri...code_variable_naming [/url]
the QCode of an array question is
QuestionCode_SubquestionCode -> e.g. Q1_SQ001

In your example you address subquestion "SQ1" and fill it with code "SQ2_A1". Meaning there is an answer option "SQ2_A1". I do not believe this.

In this example in question Q3 the subquestion codes are "SQ1" and "SQ2", the answer options are coded (as default) "A1", "A2", "A3",... 
Usually I prefer numerical codes in array questions.

If I want to prefill SQ1 with code "A3" and SQ2 with code "A1" I use this url
Code:
https://www.myServer.com/limesurvey/index.php/715486?newtest=Y&Q3_SQ1=A3&Q3_SQ2=A1
or shorter (though I prefer the first one; it's better readable, all these slashes confuse me).
Code:
https://www.myServer.com/limesurvey/index.php/715486/newtest/Y/Q3_SQ1/A3/Q3_SQ2/A1

You see I did not use the SGQ syntax. Since there is ExpressionManager/Script I use this.
Though there is this phrase in the manual

For the multiple question type, you must use a  SGQA identifier .

But a few lines later you read

  • Code:
    https://ls.example.org/1234?MULTI_SQ001=prefilled
     (New in 3.14.1 ) : Fill in the subquestion SQ001 of question with title MULTI with 'prefilled' (for a multiple text question for example).

 


2. Yes, but remember this

 Hint: The extra GET parameters are only filled in when the survey starts anew. Therefore, for testing, always add newtest=Y to start a fresh survey. For example: 

Code:
https://ls.example.org/1234?QTEXT=prefilled&newtest=Y

Meaning: If you try it in the preview, always add the "newtest=Y".

​​​​​​​Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 years 11 months ago by Joffm.
The following user(s) said Thank You: DenisChenu, boshra.m

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
2 years 11 months ago #225475 by DenisChenu
Replied by DenisChenu on topic Prefill URL and Array Question

You see I did not use the SGQ syntax. Since there is ExpressionManager/Script I use this.
Though there is this phrase in the manual

For the multiple question type, you must use a  SGQA identifier .

But a few lines later you read

  • Code:
    https://ls.example.org/1234?MULTI_SQ001=prefilled
     (New in 3.14.1 ) : Fill in the subquestion SQ001 of question with title MULTI with 'prefilled' (for a multiple text question for example).

 
 
Fixed : www.limesurvey.org/manual/index.php?titl...=172654&oldid=149102

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 following user(s) said Thank You: Joffm, boshra.m

Please Log in to join the conversation.

  • boshra.m
  • boshra.m's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 11 months ago #225535 by boshra.m
Replied by boshra.m on topic Prefill URL and Array Question
Hi,

Thank you for your response. Unfortunately, I just can't seem to get this to work and I am not sure why. To confirm, this URL is added in Text Elements --> End URL, correct?

Thank you

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #225537 by Joffm
Replied by Joffm on topic Prefill URL and Array Question
Well, show us what you tried.
Create a small sample survey with a few questions to prefill, send the lss export.
And show the url you used to prefill these questions.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
2 years 11 months ago #225542 by DenisChenu
Replied by DenisChenu on topic Prefill URL and Array Question

To confirm, this URL is added in Text Elements --> End URL, correct?

 
? No,
It must be added to the start url : prefilling can be done only outside LimeSurvey.

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.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose