Welcome to the LimeSurvey Community Forum

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

URL fields / prefill answer based on a token.

  • nique
  • nique's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 4 months ago #145402 by nique
I am mostly just after assurance that what I am doing is the best or cleanest way to do this.

I have a base survey where participants are asked a series of demographic questions and are then redirected to one of three possible surveys depending on their answers. The end URL field therefore has an equation {if(A1 == 1, Dogs, if(A2 == 4, Cats, Birds))} and this base survey has the three equations to direct them to the other appropriate LS.

The issue that I am encountering is that this survey is being sent to about 100 tokens (groups) and multiple participants can fill out the survey from the one token. So Token 1 = 100 participants. Token 2 = 50 participants etc etc.

The base survey will keep track of who has completed the survey but the follow on dog, cat surveys won't and I really do need that data. I have therefore entered an end URL field such as -- https://example/cfsls/index.php/999/lang-envar1{TOKEN} -- so that the follow on three surveys will keep track of the token used to get there. I just then have to match the Token IDs when it comes to analysing the data.

My question is, is this the best way to do this? Or, and this would be nice, can I somehow insert into the dog, cat, bird, survey a token attribute? The attributes allow me to keep track of where exactly the survey is going and having this pre-filled (but hidden) in the follow on survey data would be amazing. Or even just the Token ID would work, without the full URL.

As always, thanks in advance. This forum has been a wonderful help.
The topic has been locked.
More
7 years 4 months ago #145412 by teracomp
Replied by teracomp on topic URL fields / prefill answer based on a token.
I have a couple of surveys running now that begin on a site I built that collects user demographic information. That page then directs them to the survey with params. When they're done with the survey, the end_url directs them back to my site where I retrieve the data and point them to the next step.

A lot of the discussion is here: forum discussion

For my purposes, the important part was to have hidden questions that retain the parameters from the start of the survey. This allows me to identify the user in the lime_survey_ table for post processing.

Not sure if that helps, but hopefully provides some ideas for consideration.

Dave Phillips
The topic has been locked.
  • nique
  • nique's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 4 months ago #145769 by nique
Helps a great deal - thank you! I used tpartner's expression manager to just edit the url and copy that into the 2nd survey.

For anyone else's reference, tracking tokens won't work in my example as 2 people clicking on the same link would be directed to the 2nd survey (dogs or cats) instead of the base survey. I am glad I picked up on that issue before sending it out to my participants!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose