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
  • oledole's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 9 months 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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186336 by DenisChenu
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
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
  • oledole's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
4 years 9 months 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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186346 by DenisChenu
Replied by DenisChenu on topic Use API to prefill questions in an array question

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 .
I don't answer to private message.
The following user(s) said Thank You: oledole
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months 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.
The following user(s) said Thank You: oledole
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose