Check out the LimeSurvey source code on GitHub!

Pre-population of questions.....

More
5 years 1 month ago - 5 years 1 month ago #71371 by rocksalt
Ok... new tack...

i've deleted survey.
Created new one with single question group and two questions ( name and tel number )

played the url : index.php?sid=88997&lang=en&88997X10X50=Tommy&88997X10X51=1234

and its now populating both fields correctly.

so something in the old survey was not allowing the data to parse through?

i've stopped, started, manually edited, added data etc... generally most things i was doing to the previous survey.... and it still works... most wierd. Now im working on how to interpret the data url link from remedy into a format LS can parse
Last Edit: 5 years 1 month ago by rocksalt.

Please Log in to join the conversation.

More
5 years 1 month ago #71372 by Steve01
Hello,

I tested the SGQA for the yes/no question with a survey in my LimeSurvey installation 1.91+ Build 11379. It seems
limesurvey.local/index.php?sid=51679&51679X8X48=Y
should be correct. If it doesn't work you may have a look at the source code of your HTML page and check if the SGQA code (look for an element like <input id="answer51679X8X48Y" ... >) and the value (something like value="Y") are correct.

Mit freundlichen Grüßen/Best regards,

Stefan Gohlke
LimeSurvey Team
The following user(s) said Thank You: rocksalt

Please Log in to join the conversation.

More
5 years 1 month ago - 5 years 1 month ago #71373 by rocksalt
thanks vierundzwanzig.

Now i have the url thing working, i'm going to try the java script and embed that in the survey and interpret the url to parse data to the fields.... i feel this gives me the best way forward on this... although java and me were distant friends at best lol
Last Edit: 5 years 1 month ago by rocksalt.

Please Log in to join the conversation.

More
5 years 1 month ago #71385 by TMSWhite
rocksalt-

I just tested with 1.92 RC1. It does accept the URL parameters appropriately, with one nuance. Although you can pass in any parameters you want (which could be on any page / in any group), LS will always validate the data before displaying it. So, if you set a value of a variable that is irrelevant, LS will NULL that value before the page is displayed. This ensures that the database is internally consistent.

/Tom

Please Log in to join the conversation.

More
5 years 1 month ago #71391 by rocksalt
ahhh... for for the data im trying to parse into the question field, i need to pre validate this?
I left the validation field empty on my questions as the data being entered could be anything ( names, telephone numbers call ref etc. )
but i assume there's some kind of validation check to ensure the name Y. smitth couldn't to taken as a Y answer for yes/no ?

Please Log in to join the conversation.

More
5 years 1 month ago #71395 by TMSWhite
rocksalt-

I meant to say that 1.92 will validate whatever data you try to enter. 1.91+ may also do this, but I'm not sure about that detail.

So, using the attached sample survey as an example, if I give the following URLs, I get the described results:
http://localhost/limesurvey_dev/index.php?sid=27246&newtest=Y&lang=en&27246X5X33=Y&27246X5X35=25&27246&27246X7X37=Tom

Yields this:



and when you click next twice, you get this:



However, if I use this URL (which does not make QID 35 irrelevant):
http://localhost/limesurvey_dev/index.php?sid=27246&newtest=Y&lang=en&27246X5X33=Y&27246X5X35=25&27246&27246X7X37=Tom

You get this:



and then if you select C for Question Q2, you get this, which shows that the passed-in value of 25 for Q3 has been NULLed:



Here is the survey I'm referencing. Pages 1-2 are courtesy of lemeur:

File Attachment:

File Name: limesurvey...7246.lss
File Size:58 KB


/Tom

Please Log in to join the conversation.

More
5 years 1 month ago #71396 by rocksalt
Thanks Tom, that clears that up nicely :)

Please Log in to join the conversation.

More
5 years 1 month ago #71613 by Mazi
If you are looking for a more generic solution I can think of making an Ajax call on every survey page, passinbg a certain user ID to a PHP script. That script then gets the according data from an external DB and passes back an array which is read by some JS to populate the according survey fields (there are variations of that approach).


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 1 month ago #71641 by rocksalt
i actually solved it with a native parsing of the url.
i found the field names corresponded to the email url i was trying to push... so in the end i didn't have to do anything fancy except change the url to match what we being outputted by our template email to match that which LS was expecting.

Please Log in to join the conversation.

More
5 years 1 month ago #71714 by Mazi
rocksalt, can you post your solution at manual -> workarounds so others will benefit frim it, too?!

Thanks!


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form