Welcome, Guest
Username: Password: Remember me

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

Can a user's name be carried forward in surveys? 1 year 9 months ago #88732

  • camelchops
  • camelchops's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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!
The administrator has disabled public write access.

Aw: Can a user's name be carried forward in surveys? 1 year 9 months ago #88736

  • tomscher
  • tomscher's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 5
  • Karma: 2
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: 1 year 9 months ago by tomscher.
The administrator has disabled public write access.

Re: Aw: Can a user's name be carried forward in surveys? 1 year 9 months ago #88766

  • camelchops
  • camelchops's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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:
The administrator has disabled public write access.

Re: Aw: Can a user's name be carried forward in surveys? 1 year 9 months ago #88767

  • tomscher
  • tomscher's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 5
  • Karma: 2
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 administrator has disabled public write access.
The following user(s) said Thank You: camelchops

Re: Aw: Can a user's name be carried forward in surveys? 1 year 9 months ago #88776

  • camelchops
  • camelchops's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Yes, the lemon icon did it for me! Thanks again!
The administrator has disabled public write access.

Re: Aw: Can a user's name be carried forward in surveys? 1 year 9 months ago #88896

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5324
  • Thank you received: 294
  • Karma: 249
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)limesurvey.org'"
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.116 seconds
Donation Image