Can a user's name be carried forward in surveys?

More
4 years 11 months ago #88732 by camelchops
camelchops created the topic: Can a user's name be carried forward in surveys?
My survey starts off asking the user's name and their partner's name.

Can questions in the survey then refer to their partner by their name? In other words can I capture the first name field and carry it forward to future questions? e.g. 'What does Samantha think about drunk drivers?' I'm not good at coding by the way!

Please Log in to join the conversation.

More
4 years 11 months ago - 4 years 11 months ago #88736 by tomscher
tomscher replied the topic: Aw: Can a user's name be carried forward in surveys?
The Expression Manager can help you.

Let's assume your question is named "partnername" (=question code). Then you can use the following code in your questions:

What does {partnername.shown} think about drunk drivers?

You will find addional examples here:
=> docs.limesurvey.org/Expression+Manager+HowTos

/edit: actually it should also work just with your question code. The .shown is not necessary, but a (bad?) habit of mine.
Last Edit: 4 years 11 months ago by tomscher.

Please Log in to join the conversation.

More
4 years 11 months ago #88766 by camelchops
camelchops replied the topic: Aw: Can a user's name be carried forward in surveys?
Ah yes! The Expression Manager covers what I want to do - thanks!

Now I expect I'm being really dumb here, but when I try that, I get a red highlighted box around the question code that I entered in curly brackets, and when I hover over that it says 'undefined variable'. I expect it's something really basic I've missed ... :blush:

Please Log in to join the conversation.

More
4 years 11 months ago #88767 by tomscher
tomscher replied the topic: Aw: Can a user's name be carried forward in surveys?
You checked for typos? Embarassingly that's the most common cause in my case, so perhaps that's the reason for you as well? You have to use the exact name of the question given in the question code (check also for capital letters!). If you have problems using the EM, you could also use the somewhat older function of INSERTANS. That's the icon with the lemon in curly brackets....

Another line of approach (but actually this would imo lead to another error message): You inserted this question *after* the question of the partner's name? Otherwise it would not work, because the name has not yet been given.
The following user(s) said Thank You: camelchops

Please Log in to join the conversation.

More
4 years 11 months ago #88776 by camelchops
camelchops replied the topic: Aw: Can a user's name be carried forward in surveys?
Yes, the lemon icon did it for me! Thanks again!

Please Log in to join the conversation.

More
4 years 11 months ago #88896 by Mazi
Mazi replied the topic: Aw: Can a user's name be carried forward in surveys?
camelchops, maybe you can help others by improving our manual. E. g. by posting an example here: docs.limesurvey.org/Expression+Manager+E...tions+for+LimeSurvey


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!