Welcome to the LimeSurvey Community Forum

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

Display question in email template

  • SarcoidosisUK
  • SarcoidosisUK's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 8 months ago #171781 by SarcoidosisUK
Display question in email template was created by SarcoidosisUK
Hi.

I want to display the contents of a question in the 'Basic admin notification' email template. The question contains survey results and is currently displayed on the final page of my survey. I want to also automatically send these results to the participant.

What format do I use to enter a survey question into the email template?

Attachment shows question structure.

Thanks,
J
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171816 by DenisChenu
Replied by DenisChenu on topic Display question in email template
You can try with {QCODE.question}

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 .
I don't answer to private message.
The topic has been locked.
  • SarcoidosisUK
  • SarcoidosisUK's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 8 months ago #171825 by SarcoidosisUK
Replied by SarcoidosisUK on topic Display question in email template
Thanks for your help. The question ID I want to display is 767447X29X361
The formats below do not work:

{QCODE.question:767447X29X361}

{QCODE.767447X29X361}

What format should I be using?
Cheers
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171829 by Joffm
Replied by Joffm on topic Display question in email template
Hi,

either you use the SGQA syntax (767447X29X361)
767447 = Survey
29 = Group
361= Question
Answer (in array, multiple questions)

OR the Expression Manager syntax (QCode = Questioncode)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171830 by DenisChenu
Replied by DenisChenu on topic Display question in email template
Thanks Joffm :)
manual.limesurvey.org/Expression_Manager#Access_to_Variables

For SarcoidosisUK : when you ask for some help : please give the most information you can !

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 .
I don't answer to private message.
The topic has been locked.
  • SarcoidosisUK
  • SarcoidosisUK's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 8 months ago - 5 years 8 months ago #171851 by SarcoidosisUK
Replied by SarcoidosisUK on topic Display question in email template
Sorry for not sufficient information DenisChenu!

I am still unclear.

QCodes: I have never used QCodes before and the table in the manual does not seem useful for a novice. How do I format my question ID (767447X29X361) with QCode so that it can be inserted into an email template as I require?

SGQA: I have tried inserting the question ID in multiple formats (see template in attachment 1) but none succeed in displaying the question (see blue line in attachment 2).

Thanks again for your help guys.
Last edit: 5 years 8 months ago by SarcoidosisUK.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171855 by Joffm
Replied by Joffm on topic Display question in email template
QCode means the question code you are asked for when creating a new question.


Then there are all the additional properties

QCode.question means: the text of the question

So if your question Q1 was "How many children live in your household?"
{Q1.question} displays this text.
{Q1.code} - or only {Q1} displays the answer to this question.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, SarcoidosisUK
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar
  • Visitor
  • Visitor
5 years 8 months ago #171859 by LouisGac
Replied by LouisGac on topic Display question in email template
jfyi: in ls4, email template angine will use twig too. So it will be possible to render a question inside a mail just like in survey themes.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago - 5 years 8 months ago #171864 by DenisChenu
Replied by DenisChenu on topic Display question in email template

LouisGac wrote: jfyi: in ls4, email template angine will use twig too. So it will be possible to render a question inside a mail just like in survey themes.

This is really not needed,

I already use QuestionCode.question a lot in : email, endpage, pdf report etc …
Work really great :)

@SarcoidosisUK : try with {KSQsummary.question}

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 .
I don't answer to private message.
Last edit: 5 years 8 months ago by DenisChenu. Reason: try with {KSQsummary.question}
The following user(s) said Thank You: LouisGac, SarcoidosisUK
The topic has been locked.
  • SarcoidosisUK
  • SarcoidosisUK's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 8 months ago #171982 by SarcoidosisUK
Replied by SarcoidosisUK on topic Display question in email template
Thanks @Joffm and @DenisChenu I am now using the codes successfully. It is easy when you know how, as always!

Appreciative the help and patience there.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose