Welcome, Guest
Username: Password: Remember me

TOPIC: Value of a passthrough-field only available in first page of a survey

Value of a passthrough-field only available in first page of a survey 3 years 4 weeks ago #62891

  • pchristoph
  • pchristoph's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Hey,

We are using version 1.87+ Build 8518 and using the passthrough values (http://docs.limesurvey.org/URL+fields). We are calling the survey and appending a SessionID using the passhrough feature. This looks something like this

http://LIMESURVEY/index.php?sid=34921&token=476ea34cc419a0e5&lang=de&passthru=sessionID&sessionID=e4d7fff8-1401-583d14a-1205-332792727dff--38d70338

The survey opens fine and the SessionID is available on the first page of the survey. However when the user moves forward all of the URL-parameters and therefore the sessionID we later need is gone. I have also been looking into the html source of the page to see whether the value was stored as a hidden field - nothing. I also checked the cookies to see whether it was stored there - also nothing.

Does anyone have an idea how I can solve this?

Thanks,
Christoph
The administrator has disabled public write access.

Aw: Value of a passthrough-field only available in first page of a survey 3 years 4 weeks ago #62893

  • jelo
  • jelo's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 467
  • Thank you received: 52
  • Karma: 16
Did you put the passthru var in your endurlfield of the survey?

Or are you used to systems where the passthru is added automatically to the url?

You need to add {PASSTHRULABEL}={PASSTHRUVALUE} in the endurl field.

I normally don't use the passthru field. I create hidden questions on the first page and can save more than one passthru var. Sideeffekt is that the passthru text isn't shown in the url.
docs.limesurvey.org/tiki-index.php?page=...using_the_survey_URL

(The workarounds to hide a questions are no longer needed in newer versions. You can hide questions via GUI)

The hidden question fields can be used in the end url var.
docs.limesurvey.org/URL+fields#Answer_fields

Another good thing is that the vars are saved into the survey. The passthru is gone. Can be helpful to troubleshoot.
The administrator has disabled public write access.

Aw: Value of a passthrough-field only available in first page of a survey 3 years 3 weeks ago #62986

  • pchristoph
  • pchristoph's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Hi jelo,

many thanks for your detailed reply. Well I haven't entered it into to the end URL field because I really don't need it there. I was expecting that the passthru gets automatically added to the URL on every page. The thing is we are parsing it inside one survey question using JavaScript and now I have to find a workaround because it is not part of the URL on any page > 1.

I will look into the hidden question recommendation. The thing is just that the the sessionID is passed to LimeSurvey from another site.
The administrator has disabled public write access.

Aw: Value of a passthrough-field only available in first page of a survey 3 years 3 weeks ago #62991

  • jelo
  • jelo's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 467
  • Thank you received: 52
  • Karma: 16
You want to pass an information via URL to Limesurvey, which you want to use
inside a question during the survey process?

The limesurvey editor is allowing you to insert a placeholder of every answered question via the editor. The second button (green, right beside the save button).

1. Create a hidden question (mostly free text).
2. Find out what the SGQA of this hidden question is:
docs.limesurvey.org/tiki-index.php?page=SGQA%20identifier

3. Modify the URL which links to your survey
If the SGQA of the hidden question is 1X6X121ab1,
you would add "&1X6X121ab1=MYSESSIONID" to the surveyurl.

The site would then need to replace the MYSESSIONID with the real SessionID.

That works without a problem and is the standard procedure when using access panels which provide respondents via an ID. Unusual is only the cryptic SQGA since that is uncommon in the survey industry (other packages allowing you to used selfdefined fieldnames).

If the URL from the site which links to your survey cannot modify the URL in your way you will need to program a small phpscript or htaccess rewrite rules to rewrite the URL and then link to your survey. You would lost the referrer information inside limesurvey), which would only be interesting if the surveylink is on different sites or parts of the sites. If not, you are losing no information.
The administrator has disabled public write access.

Re: Aw: Value of a passthrough-field only available in first page of a survey 3 years 3 weeks ago #63052

  • pchristoph
  • pchristoph's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Hi jelo,

This sounds promising. I will test it and get back to you.

Thanks
Christoph
The administrator has disabled public write access.

Re: Aw: Value of a passthrough-field only available in first page of a survey 3 years 3 weeks ago #63102

  • pchristoph
  • pchristoph's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Hi jelo!

I realised this is not feasible since I want to use this solution in many different surveys. In that case it would not work since the SGQA identifier is different every single time and I would need to use a specific theme with a specific javascript file to parse that one SGQA.

Thanks,
Christoph
The administrator has disabled public write access.

Re: Aw: Value of a passthrough-field only available in first page of a survey 3 years 3 weeks ago #63103

  • jelo
  • jelo's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 467
  • Thank you received: 52
  • Karma: 16
You're right, that on every new created/copied survey the SGQA changes.

The converting routine would change the SGQA automatically in the survey.

So what changes is the link to the survey. But that will change anyway when you create many surveys the ID of the survey will be different. So you would need to provide new links to the site your links are used anyway.

I still don't get why you need a specific javascript routine to parse the SGQA. To just publish the SGQA in a question text (or say what you want to do with the variable inside the survey. Still unclear to me) you just paste the placeholder via the editor. When importing/copying the survey this placeholder will be converted to the new SGQA. SGQAvar inside Javascript are also converted.

You really should attach an example survey and show us where you want to use the information of the passin var.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.126 seconds
Donation Image