Use variables (eg. username) in survey

Plus d'informations
il y a 1 an 2 semaines #174584 par 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

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 1 an 2 semaines #174585 par holch
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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Les utilisateur(s) suivant ont remercié: juppix

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174587 par juppix
Great! But is it also possible to use this variables as prefilled answers? As a proposed answer?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174588 par holch
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'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174589 par juppix
Yes ! I mean this!
Could you explain your answer a bit?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174591 par juppix
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?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174593 par jelo
Réponse de jelo sur le sujet 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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174595 par DenisChenu
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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174598 par juppix
Okay... please find the file attached :)
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174631 par juppix
Hi !
I tried everything - no result :-/

My formula:

{if(is_empty(kontaktinfos.SQ001),"",{TOKEN:ATTRIBUTE_8})}

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174632 par DenisChenu
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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174651 par juppix
Thanks! But the input field is empty :-(
Please take a look at the screenhot (attachment).
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174655 par holch
I am actually not quite sure what you are trying to do here. Could you explain again what exactly should be happening?

Because the code you wrote checks if the field is empty.

If the field is empty it should write "Leer" (Empty) and if there is already something in there it would write "Gefüllt" (filled). So in the later case it would actually overwrite what is in the field and write "Gefüllt" over it.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174656 par jelo
Réponse de jelo sur le sujet Use variables (eg. username) in survey
Attach your current survey to check for errors. Might be a issue with LimeSurvey, might be a little mistype. Which version of LimeSurvey is used?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 an 2 semaines #174658 par juppix
I have addidition fields in the database (Additional user infos).

If have some questions and I want that a user could re-open his survey (edit fields after submitting survey).

If a user opens the survey first time I want to provide a "predicted"/prefilled answer (from the database).
Then the user can usethis predicted/prefilled answer or could insert another answer. After that he submitts the survey again.
If he re-opens his survey he should get his old values as answers (not stored from the database).
I hope I could explain it correctly. Or better: read the first 3-4 posts of this topic to understand what I mean ;)

VERSION:
Version 3.14.10+180924

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!