Welcome to the LimeSurvey Community Forum

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

How can I insert the multiple choice other answer in email template ?

  • OlivierDestrade
  • OlivierDestrade's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 3 weeks ago #252944 by OlivierDestrade
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.3.7
Own server or LimeSurvey hosting: cloud
Survey theme/template: default
==================
I want to sent a confirmation mail with the survey responses in the body of the email.
I'm using the syntax "Nom" : {INSERTANS:SurveyIDXGroupIDXQuestionID} which works well for most questions.
Now I have a multiple choice question with the Other option activated. If the user choose Other in the survey, the value that is rendreded in email is "-oth-".
I searched the doc how to render the other value option and found this syntax {QUESTIONCODE_other} but the result in the mail body is :
"Autre" : " < em > G01Q06_other < / em > "
with underlying HTML : "
Code:
<p>"Autre" : "<span class='em-expression em-haveerror'  ><span class="em-compare"> < </span><span class='em-error' title=' ' ><span title='Variable non définie' class='em-var em-var-error' >em</span></span><span class="em-compare"> > </span><a title='[java371828X3X14other][G:0][Q:5]: <span class="M7eMe">Comment avez-vous connu La Cagette ?</span>; value=CHIC' class='em-var em-var-static' href='/questionAdministration/view/surveyid/371828/gid/3/qid/14' >G01Q06_other.value</a><span class="em-compare"> < </span><span> / </span><span class='em-error' title=' ' ><span title='Variable non définie' class='em-var em-var-error' >em</span></span><span class="em-compare"> > </span></span>"</p>
What should be the correct syntax to render the "other" answer to a multiple choice question in email ?  


 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 3 weeks ago #252947 by tpartner
Export the data with answer and question codes and check the column names.

I think it's probably G01Q06_oth.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • OlivierDestrade
  • OlivierDestrade's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 3 weeks ago #252952 by OlivierDestrade
Thanks for your reply !

Unfortunately, G01Q06_oth render the following
< i > G01Q06_oth < / i >
:-(

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 3 weeks ago - 11 months 3 weeks ago #252953 by Joffm
Hi
as @tpartner

and check the column names.

or read the manual
[url] www.limesurvey.org/manual/ExpressionScri...code_variable_naming [/url]

For comment and other, the corresponding question codes are QuestionCode_comment and QuestionCode_other, respectively.


I am surprised that you use the latest release (6.3.7.) but also use the stone age "INSERTANS".
Since ExpressionScript was introduced (I think in version 2.0.0.) we use this.

In your case {Q01Q06_other}  is sufficient.
ExpressionScript is surrounded by curly brackets.
This you may read here ("Introduction" and "Key definitions")
[url] www.limesurvey.org/manual/ExpressionScri...tion/en#Introduction [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 11 months 3 weeks ago by Joffm.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • OlivierDestrade
  • OlivierDestrade's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 3 weeks ago - 11 months 3 weeks ago #252972 by OlivierDestrade
Thanks a lot @Joffm !

Yes, {Q01Q06_other} is working fine now.

P.S. I'm new to LimeSurvey and INSERTANS was the first sample I found to insert survey answers in email. I've juste changed to question name syntax and it's more easy to read and maintenable.
Last edit: 11 months 3 weeks ago by OlivierDestrade.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose