Welcome to the LimeSurvey Community Forum

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

Getting a survey response into Admin Notification subject line or attribute

  • jsavage
  • jsavage's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #105695 by jsavage
I have seen how it is possible to pre-populate survey answers with attributes.
Is it possible to do the reverse and place a response into an attribute? This is simply to make it easier to get an indication of high level results in the email box or in the Token Management Area.

Lets take the simplest example - a survey with one question and a Yes/No answer. My survey has an additional attrribute called response1.

1. How can I get the answer to Question 1 rto be placed back into the attribute response1 ?

2. if that is not possible, then how about displaying the answer Y/N in the subject line of the notification?

Thanks all,

James
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 month ago #105707 by tpartner
You cannot write survey responses to the tokens table without an AJAX call to a remote PHP script.

However, in the email editor you can use Expression Manager to pipe responses into the subject line (or in the mail body) like this:

Code:
Response submission for survey {SURVEYNAME}. Q1 answer: {q1.shown}




.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: jsavage
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 month ago #105710 by DenisChenu

tpartner wrote: You cannot write survey responses to the tokens table without an AJAX call to a remote PHP script.

Or with the new event : afterSurveyComplete ;)
manual.limesurvey.org/Plugin_events

Denis

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 month ago #105714 by tpartner
That would be great if I could actually get a plugin to work.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • jsavage
  • jsavage's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #105719 by jsavage
sounds promissing. Will take a look.
James
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 1 month ago #105723 by DenisChenu

tpartner wrote: That would be great if I could actually get a plugin to work.

I don't actually test afterSurveyComplete, but did you try ShowResponse plugin ?
You need to move it from plugins/demo/ to plugins/ directory.

He use pluginManager->getAPI()->getResponse, seems promising :)

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.
  • jsavage
  • jsavage's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 1 month ago #105740 by jsavage
OK - Have that plug in activated but I haven't found any documentation for it. I would even be happy to write the documentation if I could only someone could explain how it is supposed to be used.

Kind regards,

James
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose