Survey responses via email?

shris
Kilo Contributor

Hi.

Has anyone used an inbound email action to parse responses to survey invitations?

We have a survey with just a few questions. We want to include the survey questions in the email invitation (shouldn't be a big deal, just have to lay it all out in HTML), so the user can reply with the answers to each question. Then when SNC receives the reply, we want the survey 'responses' to be properly populated from the email message.

So if I design a notification that contains a form with some inputs:
Question 1 (select with 5 options)
Question 2 (select with 5 options)
Question 3 (select with 5 options)
Question 4 (select with 5 options)
Question 5 (multi-line comment box)

I'd like the user to be able to hit a button on the form (or 'reply' or something) to send the data to SNC so it can be parsed. I think there are multiple possible ways to do this (either via a long and painful URL with sysparms or a very elaborate inbound email action). But has anyone already done this, and if you have, can I have a look at your method? 🙂

Thanks in advance

6 REPLIES 6

shris
Kilo Contributor

Argh. Forgot to mention we're using task-based survey plugin..


Garrick
ServiceNow Employee
ServiceNow Employee


shris


Looking at this too. Do you have html enabled email at your org? We're thinking of potentially embedding the default survey page into email it self.....few issues to still work through first.


shris
Kilo Contributor

We use HTML formatted emails all the time, with tables and colors mostly. Not entirely sure if that's what you mean by 'html enabled email'..

We couldn't figure out how to format a URL that would populate the fields on the survey form. It seems to be a special form, and the URL was unsuccessful in populating them the way you can do on regular forms. And we are honestly concerned about a reply email because email formatting has had to be so precise (field:value pairs, etc.) and end users cannot be relied upon to get that perfect.

shris


SteveS
Kilo Expert

I was having a similar problem with getting the exact responses from the person that took the survey but have found a solution that works pretty well.

I basically did all the steps from another posting Survey Results Notification to setup an email notification with the results from a completed Survey and then had to setup an email notification to me that was tailored to meet my requirements. While its plain text and not very pretty, it does give you the responses from the survey. (though there is a couple of fields like who closed the incident or who the incident was assigned to that I can not get to work but I am dealing with it.)

Here is my tailored email notification, again I followed the setup for this in the other posting and then just tailored the email to my needs. O and I had to take out carrots<> by mail_script for it to show


mail_script
template.print("Summary of Survey responses:\n");
var gr = new GlideRecord("survey_response");
gr.addQuery("instance", current.sys_id);
gr.query();
while(gr.next()) {
template.print(gr.question.question_text.getDisplayValue() + ': ' + gr.response+ "\n");

}
/mail_script
Task Survey Information:
mail_script
var gr = new GlideRecord("task_survey");
gr.addQuery("instance", current.sys_id);
gr.query();
while(gr.next()) {
template.print("Incident #:" + gr.task.number);

}
/mail_script
Taken on: ${taken_on}
Sys ID: ${sys_id}