Welcome to the LimeSurvey Community Forum

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

Use other responses as input

  • nexoness
  • nexoness's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #188106 by nexoness
Use other responses as input was created by nexoness
Hi there!

We are currently working on a survey where users are asked what the Best Before date of certain products are. This is to remove them once expired. We've populated the survey with all questions, but we need to figure out how to use the Best Before Dates from Response A as input for the next time someone takes the survey. Is this possible?
The topic has been locked.
More
4 years 7 months ago - 4 years 7 months ago #188127 by tobite
Replied by tobite on topic Use other responses as input
If I get you right, you know the respondents already and would send out a link later based on your database. You could simply send out a link with URL parameter that prefills a new (if you want, hidden) question in your next survey.

In other words: when you invite them next time with tokens from participant table, make the link from your old responses like this:
Code:
https://ls.example.org/1234?token=yourtoken&QuestBBDTEXT=theBBDyouaskedbefore

Read more here: manual.limesurvey.org/URL_fields
That's my suggestion at least. Good luck!
Last edit: 4 years 7 months ago by tobite. Reason: example URL was converted into clickable and shortened, now as code can see the structure
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188130 by holch
Replied by holch on topic Use other responses as input
From one response you can not access answers to other responses directly from Limesurvey. You might need to create a ajax call directly to the database.

Or if this is feasible for you, pass the answer from the current response via end url to the next response. But I didn't really understand what you are actually trying to achieve, so it is difficult to tell.

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.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 7 months ago #188172 by DenisChenu
Replied by DenisChenu on topic Use other responses as input
Or create a plugin :)

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 topic has been locked.
  • nexoness
  • nexoness's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 7 months ago #188377 by nexoness
Replied by nexoness on topic Use other responses as input
To further explain this:

I've linked to the survey within a phone app, this is where someone sees the products in a list with input fields for the Best Before Date, Let's say Bob opens the app and fills in what date it is, he then checks the Best Before Date of the peanut butter, which is 1-1-2020 and fills this into the field and submits the survey.

Tom opens the app on 1-1-2020 and needs to be shown that he needs to check the peanut butter because the Best Before Date is almost expired. Both of them use the same account/token to access the survey.

Bob --> Best Before Date of Peanut Butter --> Submit survey --> data gets stored in the database
--> Tom opens survey with the same token and is already presented with the dates Bob had filled in, but only the dates that are the same as the date filled in at the start of the survey.


Q1 - What date is it tomorrow?
Q2 - Best before date of +200 products (subquestions with input other than the same value as Q1 get hidden)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose