Use API to prefill questions in an array question

More
5 months 12 hours ago #186307 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.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
4 months 3 weeks ago #186336 by DenisChenu
Hi,

manual.limesurvey.org/Expression_Manager..._Assignment_Operator

Then a (single) equation question type with
{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 .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: oledole

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186345 by oledole
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.

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186346 by DenisChenu

The recommended method is to always use an equation question.

Source : manual.limesurvey.org/Expression_Manager..._Assignment_Operator

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 .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: oledole

Please Log in or Create an account to join the conversation.

More
4 months 3 weeks ago #186347 by tpartner
Can you not prefill the sub-questions 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.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: oledole

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!