Welcome to the LimeSurvey Community Forum

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

LimeSurvey 7 - How to include selected options from a Multiple Choice question i

More
11 hours 23 minutes ago #274727 by asanacori
Hello,I am using LimeSurvey 7 and I am customizing the admin notification email template (the email sent to administrators after a respondent submits the survey).I have a Multiple Choice question with the following settings:
  • Question code: ReqAmm
  • Subquestion codes: SQ001, SQ002, SQ003, etc.
 My goal is to display in the email only the options selected by the respondent.I tried using ExpressionScript such as:<ul>{if(ReqAmm_SQ001 == 'Y', join('<li>', ReqAmm_SQ001.question, '</li>'), '')}{if(ReqAmm_SQ002 == 'Y', join('<li>', ReqAmm_SQ002.question, '</li>'), '')}{if(ReqAmm_SQ003 == 'Y', join('<li>', ReqAmm_SQ003.question, '</li>'), '')}</ul>I also tried placeholders such as:    {ReqAmm}     {ReqAmm.shown}    {ReqAmm_SQ001}However, none of these are evaluated, the email contains the expressions exactly as written (literal text), for example:{ReqAmm.shown} {ReqAmm_SQ001}instead of the expected values.My questions are:1. What is the correct way to access the selected answers of a Multiple Choice question in that email?2. Is there a specific placeholder or syntax that should be used for question code ReqAmm and subquestions SQ001, SQ002, etc.? Any example would be greatly appreciated.Thank you!=====================================
Please help us help you and fill where relevant:
Your LimeSurvey version: 7
Own server or LimeSurvey hosting: my server

Please Log in to join the conversation.

More
3 hours 16 minutes ago #274730 by holch
For this kind of question it is always helpful to include a small sample survey that shows the structure of this question. Because the error could be in the details.

And before you start with the email, which is a lot more difficult to debug, make sure that your code works in the survey itself (easier to debug). Create a text display question after the respective question and try to display what you want in the email there first.

You'll have a lot quicker "feedback" on what works. That's how I would approach this.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose