- Posts: 10
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Prefilling Survey Using Methods Other Than URL
- bkane
- Topic Author
- Offline
- New Member
Less
More
8 years 11 months ago #118823
by bkane
Prefilling Survey Using Methods Other Than URL was created by bkane
I need to prefill a survey with answers for up to 50 questions (mostly numeric or short text) which will be hidden from the user, for example, ans1, ans2... ans50.
The survey will require a token as well.
Prefilled answers will be accessed by other survey questions in javascript functions using {qcode.shown} expression, i.e. {ans1.shown}.
I am able to get this to work by passing the survey answers in the URL, but due to the large number of parameters needed, the potential for people editing the URL, etc., I was hoping to use
a query to update the LimeSurvey table (lime_survey_sid).
While I was successful at doing this using the token value, it appears that the answers are not available to my javascript function using either {qcode.shown} or {qcode.NAOK} despite allowing multiple responses in token settings.
I suspect that the survey is not pulling answers from the lime_survey_sid table at start-up, but I was wondering if there was a way to force this?
The survey will require a token as well.
Prefilled answers will be accessed by other survey questions in javascript functions using {qcode.shown} expression, i.e. {ans1.shown}.
I am able to get this to work by passing the survey answers in the URL, but due to the large number of parameters needed, the potential for people editing the URL, etc., I was hoping to use
a query to update the LimeSurvey table (lime_survey_sid).
While I was successful at doing this using the token value, it appears that the answers are not available to my javascript function using either {qcode.shown} or {qcode.NAOK} despite allowing multiple responses in token settings.
I suspect that the survey is not pulling answers from the lime_survey_sid table at start-up, but I was wondering if there was a way to force this?
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 11 months ago #118826
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Prefilling Survey Using Methods Other Than URL
Why don't you write this data in custom attributes of the token table? You can access those from within the survey, you can export them together with the survey results and they are hidden from the user.
As you require tokens anyway, this is the cleanest solution.
You can access these values with something like {TOKEN:ATTRIBUTE_1}, {TOKEN:ATTRIBUTE_2} etc.
As you require tokens anyway, this is the cleanest solution.
You can access these values with something like {TOKEN:ATTRIBUTE_1}, {TOKEN:ATTRIBUTE_2} etc.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: bkane
The topic has been locked.
- bkane
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 1
8 years 11 months ago #118827
by bkane
Replied by bkane on topic Prefilling Survey Using Methods Other Than URL
Brilliant idea! I can't wait to try it. Many thanks for pointing me in the right direction.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11746
- Thank you received: 2750
8 years 11 months ago #118828
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Prefilling Survey Using Methods Other Than URL
It works pretty well. For a Telephone survey I pipe information about the respondents into the survey and the interviewers can basically see the first name, last name, company name, sector code, address, telephone numbers etc.
All this information is stored in the token table and comes from a list that is either purchased from list providers or from the list of customers that our client provides us. Works fine.
You only need to set it up. Once it works and is tested you can create the token table in excel and upload it as CSV.
All this information is stored in the token table and comes from a list that is either purchased from list providers or from the list of customers that our client provides us. Works fine.
You only need to set it up. Once it works and is tested you can create the token table in excel and upload it as CSV.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.