Welcome to the LimeSurvey Community Forum

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

Use variables (eg. username) in survey

  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174584 by juppix
Hi all,

I want to create a pesonalized welcome page. Something like:

"Welcome {username}!"

Is it possible to use variables from the attendees list?
user firstname, lastname, email...

thanks
jup
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174585 by holch
Replied by holch on topic Use variables (eg. username) in survey
Have a look at the participant table, tokens and custom attributes.

You can create custom attributes, upload the list as CSV and display these custom attributes via expression manager in the survey.

Have a look at micro tayloring in the manual regarding the expression manager.

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

The following user(s) said Thank You: juppix
The topic has been locked.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174587 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Great! But is it also possible to use this variables as prefilled answers? As a proposed answer?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174588 by holch
Replied by holch on topic Use variables (eg. username) in survey
What do you mean with "prefilled answer", proposed answer?

Do you mean e.g. number of children. You have the number of children in the database, so you want to put this as the default answer? This is also possible, but depends a little bit on the question type you are using.

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.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174589 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Yes ! I mean this!
Could you explain your answer a bit?
The topic has been locked.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174591 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Okay. I tried it and it works.
BUT: I want that users can reopen their survey and change the informations filled in before.
Now, if I use a {TOKEN:FIRSTNAME} as suggested answer, I would get always the info from the database.
Is it possible to check wether the user answered this question before? if so there should appear the user input text - not the database text.
you know what I mean?
The topic has been locked.
More
5 years 6 months ago #174593 by jelo
Replied by jelo on topic Use variables (eg. username) in survey
You will need to use ExpressionManager (which is a Script language, soon called ExpressionScript).
But depending on the questions, where you want to assign default values, it might be a bit tricky.
If the question has a default answer value, you might check via is_empty on the fieldcontent.
Can you provide a simple survey as an example (lss export)?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174595 by DenisChenu
Replied by DenisChenu on topic Use variables (eg. username) in survey
For last name etc (text question), directly use {TOKEN:LASTNAME} in default value.

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.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174598 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Okay... please find the file attached :)
The topic has been locked.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174631 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Hi !
I tried everything - no result :-/

My formula:

{if(is_empty(kontaktinfos.SQ001),"",{TOKEN:ATTRIBUTE_8})}
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 6 months ago #174632 by DenisChenu
Replied by DenisChenu on topic Use variables (eg. username) in survey
Because it must be
{if(is_empty(kontaktinfos.SQ001),TOKEN:ATTRIBUTE_8,kontaktinfos.SQ001)}
in an equation question type

But : use manual.limesurvey.org/Default_answers for short text

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.
  • juppix
  • juppix's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #174651 by juppix
Replied by juppix on topic Use variables (eg. username) in survey
Thanks! But the input field is empty :-(
Please take a look at the screenhot (attachment).
Attachments:
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose