Welcome to the LimeSurvey Community Forum

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

Token attributes in answers

  • mjoldman
  • mjoldman's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 9 months ago #136973 by mjoldman
Token attributes in answers was created by mjoldman
Hi,
I have a fairly simple need which I think Limesurvey can handle easily.
I have a token controlled survey - the names and emails can be blank as I am manually giving the code to respondents offline.
I want to record an attribute (operator name) along with the answers so that ultimately I can search the data by this (ideally from within limesurvey and generate custom exports).
This attribute will be automatically filled from the token table when the form is submitted

Having browsed the manual and other forum posts it would seem I could do this simply using the default answer field.

I have done the following
- set a short text question
- set this to hidden
- entered the default value as {TOKEN}
The good news is that this works, but as you would expect it just records the access token value.

I have tried storing my desired value (operator name) in the Token Firstname, Token Firstname, Token email and Token attribute_1 etc fields.
I have altered the default answer value in the question from {TOKEN} to the appropriate value e.g {TOKEN:LASTNAME} as per the documented syntax but now nothing is recorded at all - a blank entry. I have tried without the TOKEN prefix e.g{LASTNAME} on its own and this doesn't work either - I just get "LASTNAME" recorded as text not the value.

The only thing that works is the {TOKEN} by itself and obviously I can use this as I need it as an access code.

Cant believe this hasn't been done before.

Please help! Thanks in advance.


Version 2.06+ Build 150723
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 9 months ago #136987 by holch
Replied by holch on topic Token attributes in answers
{TOKEN:LASTNAME} should work, given that your token table has a column called "LASTNAME", from your list you only have Firstname? And actually for what you are trying to do, you don't need to pass the token attributes to the survey. You could just export it together with the results.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 9 months ago #136991 by DenisChenu
Replied by DenisChenu on topic Token attributes in answers
Maybe {TOKEN:ATTRIBUTE_1} if you fill the attrbute 1.

Your suyrvey need to be not anonymous.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose