Check out the LimeSurvey source code on GitHub!

set a default value from token table when hiding the question

3 years 5 days ago #105275 by elementb
Hey there,

I have a "short free text" question to ask for the email adress.

I want to hide this question for people who have an email address in the token table -> WORKS

All others must enter their email address.

In the Results table I want to see all email addresses of people who have it in their token record as well.

I tried to set {TOKEN:EMAIL} in the default value field.

But it does not work ... is this because its a hidden question for them?

Any ideas?

Thank you so much.


Please Log in to join the conversation.

3 years 5 days ago - 3 years 5 days ago #105277 by tpartner
Yes, if the question is hidden by relevance or conditions, it will not be loaded with a default answer.

A solution may be to hide it with JavaScript instead of relevance.

1) remove the relevance or conditions from the question.

2) Use this as the default answer:

3) Add this script to the source of the question:
<script type="text/javascript" charset="utf-8">	
		var tokenEmail = '{TOKEN:EMAIL}';
		if(tokenEmail.length > 0) {


Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 5 days ago by tpartner.

Please Log in to join the conversation.

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