Welcome to the LimeSurvey Community Forum

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

Pre-fill answer with entry URL

  • nmillstoshibatap
  • nmillstoshibatap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #162298 by nmillstoshibatap
Pre-fill answer with entry URL was created by nmillstoshibatap
I've read many forum and manual posts, but can't get this to work at all.(A few years ago I had it working on an earlier version of LS.)

I'm running the latest version through LS.

For Q1 which I have hidden I want to record a response of Yes or No. (That is the question type.) However I can't get any URL to work for me. I must be missing something really simple, but I can't see it.

I can't use the Panel Integration as this only appears to work for text fields.

These are the variations I've tried without success.

example.com/145251?lang=en/eb?Q1=Y

example.com/145251?lang=en/Q1="Y "

example.com/145251?lang=en/eb?Q1=Y

example.com/145251?Q1="Y"&newtest=1

example.com/145251?14251X1=Y

example.com/145251?Q1=Yes&newtest=1

What am I missing??

Thanks in advance
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 9 months ago #162322 by tpartner
Replied by tpartner on topic Pre-fill answer with entry URL
Have you tested with the question visible?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • nmillstoshibatap
  • nmillstoshibatap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #162381 by nmillstoshibatap
Replied by nmillstoshibatap on topic Pre-fill answer with entry URL
Yes I have, the question is not answered
The topic has been locked.
More
6 years 9 months ago #162382 by jelo
Replied by jelo on topic Pre-fill answer with entry URL

nmillstoshibatap wrote: I'm running the latest version through LS.

Which translates into what exact version. The "latest" is never helpful. You don't know when the next latest is released. So numbers please.


Start with complete URLs to check issues with rewriting the URL first. Start with a simple textquestion, which shows the text of the get variable. If that is working, than try it with the other questionstypes.

Post a complete URL from your surveylink (you can change the domainname to something different e.g www.xyz.tld/ ).

www.xyz.tld/index.php/survey/index/sid/0...questioncode2=answer

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • nmillstoshibatap
  • nmillstoshibatap's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 9 months ago #162387 by nmillstoshibatap
Replied by nmillstoshibatap on topic Pre-fill answer with entry URL
Thanks jelo, the version I'm using is 2.72.6.

I used your troubleshooting advice and got it running within minutes as I wanted it. can't figure out why it wouldn't work before, but I got the output I wanted.

A working URL looks like this:

example.com/145251?newtest=Y&Q101=N

Thanks
The topic has been locked.
More
6 years 2 months ago #172239 by TomBenj
Replied by TomBenj on topic Pre-fill answer with entry URL
Looking at the last post I thought I would be able to get this to work using the querystring parameters &question275=mystringoftext.
But it's not working! I picked on "question275" because that is the id of the div in the web page that contains the question. The id of the input field itself is "answer837571X11X275" - which makes sense 83751 is the id of the survey, 11 is the id of the question group, and 275 is the id of the question. What am I missing?
I am running version 2.55.1+161026

Thanks,
Tom

Tom Benjamin
President, CUPE Local 1978
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago #172247 by Joffm
Replied by Joffm on topic Pre-fill answer with entry URL
Hi,

the GET-Parameter is the Question code.

As nmillstoshibatap wrote:
example.com/145251?newtest=Y&Q101=N

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 2 months ago #172258 by tpartner
Replied by tpartner on topic Pre-fill answer with entry URL

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 2 months ago #172290 by TomBenj
Replied by TomBenj on topic Pre-fill answer with entry URL
Seems that newtest=Y is the key. Thanks!
Tom

Tom Benjamin
President, CUPE Local 1978
The topic has been locked.
More
6 years 2 months ago #172291 by jelo
Replied by jelo on topic Pre-fill answer with entry URL
newtest=Y is causing a new session. Nothing more, nothing less.
Not sure why that should be the key for prefilling variables via URL.
You might have issue when testing in one browser without resetting the session.
But during a live field you might not use newtest=Y to allow respondents to stay in the interview when reentering the URL.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: TomBenj
The topic has been locked.
More
4 years 10 months ago - 4 years 10 months ago #192064 by asilbering
Replied by asilbering on topic Pre-fill answer with entry URL
Hi all,

I am having some trouble to prefill with URL.
When I try to fill a simple text question it works fine, but when I try to fill a subquestion in a multiple short text question it does not work.
I am following the syntax presented here:
www.limesurvey.org/manual/URL_fields/en#...using_GET_parameters

The question I am trying to prefill is EnsList and the subquestion is Ens01.

And my url looks like this:
xxx-test.xxx.ch/index.php?r=survey/index...01=Complet&newtest=Y

Any ideas?

I also have a question regarding the newtest=Y parameter. I have two surveys, one parent, one child.
The parent survey contains a multiple short text with a list of links (each a subquestion) that leads to the child survey using different tokens, the answer fields are read only. The list of tokens of the child survey are stored in a token attribute of the parent survey.
The end url of the child survey leads back to the parent survey and fills the answer field of the corresponding subquestion with the word "complete".
My question is:
If I use newtest=Y will the previously prefilled answers be erased ?
I hope I am clear.

Thanks in advance for your precious help!
Best regards,

Ana
Last edit: 4 years 10 months ago by asilbering.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 10 months ago - 4 years 10 months ago #192068 by Joffm
Replied by Joffm on topic Pre-fill answer with entry URL
Hi, Ana,

I tried with
www.example.de/survey/index.php/947394?l...ewtest=Y&Q1_SQ002=My prefilled text in SQ002&Q1_SQ004=My prefilled text in SQ004
and got the expected

It also worked without "newtest=Y".


Joffm

Oh, now you attached your sample; thank you

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 10 months ago by Joffm.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose