- Posts: 28
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Use API to prefill questions in an array question
- oledole
- Topic Author
- Offline
- Junior Member
Less
More
4 years 9 months ago #186307
by oledole
Use API to prefill questions in an array question was created by oledole
Hi.
I've been using the remote_control API to create a survey using certain data that they select on an application I've made. This survey consists of an array (texts) question with 1 subquestion for each option the user selected on the application.
For each subquestion there are three text inputs. While I want the user to fill in one, I want the other fields to be filled in by automatically using the data the user selected. I can send the data to the survey as a custom attribute or in a hidden question or however, but how can I prefill the questions using this data?
Thank you for your assistance.
I've been using the remote_control API to create a survey using certain data that they select on an application I've made. This survey consists of an array (texts) question with 1 subquestion for each option the user selected on the application.
For each subquestion there are three text inputs. While I want the user to fill in one, I want the other fields to be filled in by automatically using the data the user selected. I can send the data to the survey as a custom attribute or in a hidden question or however, but how can I prefill the questions using this data?
Thank you for your assistance.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 9 months ago #186336
by DenisChenu
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.
Replied by DenisChenu on topic Use API to prefill questions in an array question
Hi,
manual.limesurvey.org/Expression_Manager..._Assignment_Operator
Then a (single) equation question type with
manual.limesurvey.org/Expression_Manager..._Assignment_Operator
Then a (single) equation question type with
Code:
{Q00_SQ01_SQ01="something"} {Q00_SQ01_SQ02="something other"} …
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 following user(s) said Thank You: oledole
The topic has been locked.
- oledole
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 28
- Thank you received: 0
4 years 9 months ago #186345
by oledole
Replied by oledole on topic Use API to prefill questions in an array question
Hi, thank you for the reply.
I'm not completely sure how to use this to solve my problem. Do i use this inside the source of my question?
My issue:
I've an application where user enter some lines of information and click send.
The application then creates the survey and creates an array text question with subquestions equal to the number of lines of information entered.
Two of the answers in each subquestions should be pre-filled with the information entered in my application.
I can send the data from the application to limesurvey with attributes or hidden questions etc but not sure how to prefill the answers automatically.
I'm not completely sure how to use this to solve my problem. Do i use this inside the source of my question?
My issue:
I've an application where user enter some lines of information and click send.
The application then creates the survey and creates an array text question with subquestions equal to the number of lines of information entered.
Two of the answers in each subquestions should be pre-filled with the information entered in my application.
I can send the data from the application to limesurvey with attributes or hidden questions etc but not sure how to prefill the answers automatically.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
4 years 9 months ago #186346
by DenisChenu
And in equation : use equation setting .
It's a solution … since you create the survey : you can prefill directly the value … (but with an equation : you force the value even after submit)
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.
Replied by DenisChenu on topic Use API to prefill questions in an array question
Source : manual.limesurvey.org/Expression_Manager..._Assignment_OperatorThe recommended method is to always use an equation question.
And in equation : use equation setting .
It's a solution … since you create the survey : you can prefill directly the value … (but with an equation : you force the value even after submit)
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 following user(s) said Thank You: oledole
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
4 years 9 months ago #186347
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Use API to prefill questions in an array question
Can you not prefill the sub-questions using GET parameters?
- manual.limesurvey.org/URL_fields#Prefill...using_GET_parameters
- manual.limesurvey.org/URL_fields#Prefill...using_GET_parameters
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: oledole
The topic has been locked.