How can I export results to an Google Doc


How can I export the results on eLearning of my students to an excel spreadsheet


Please follow this tutorial


Thanks, but as soon as I paste the code I get an error message


The code in the tutorial is formatted incorrectly. Please clone the sample Google sheet as described in the following post:


Hi, Sorry to bother again, I cloned your sample on the Google Sheets, copied your script and pasted into my sheet.

I have changed the script to:

var TO_ADDRESS = “”; // Email to receive the report data
function doPost(e) {
try {
var report = JSON.parse(;

// Insert report data to Google Sheets
var doc     = SpreadsheetApp.getActiveSpreadsheet();
var sheet   = doc.getSheets()[0]; // get the first sheet
var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
var nextRow = sheet.getLastRow()+1; // get next row
var row     = [ new Date() ];
// loop through the header columns
for (var i = 1; i < headers.length; i++) { // start at 1 to avoid Timestamp column
  if(headers[i].length > 0) {
    row.push(report[headers[i]]); // add data to row
sheet.getRange(nextRow, 1, 1, row.length).setValues([row]);

// Send report data via email
  subject: "Report Data" + " - " + report.Name,
  htmlBody: JSON.stringify(report)

return ContentService    // return json success results
                        "data": JSON.stringify(report) }))

} catch(error) { // if error return this
return ContentService
.createTextOutput(JSON.stringify({“result”:“error”, “error”: e}))

Got to the next step and copied the link. Pasted into my Active Presenter quiz, saved, run the quiz, could add my name but then got an error message.


I am not sure what I am doing wrong.

Thanks for your help.

Kind regards


Please make sure that:

  • Options are selected correctly when creating the web app
  • The app URL is copied/pasted correctly

If the error still persists, please open the web browser developer tools (press F12) to see if there’s any error messages in the Console tab.


Thank you - it is working!!!:grin:

Hi Toan,

Can this be method be adapted to send (via email) the results of a survey with Likert and essay type questions?

Thanks kindly,

Hi Scott,

Both send email and send data to Google Docs functions work for all kinds of questions.


Hi Nam,

I made a survey with a single Likert question and an essay response. I was able to get it to work using a cloned version of the sample Google Sheet pasted earlier in the thread. Unfortunately, this Google Sheet contains information I do not need and I wanted to cut it down to the bare essentials. The only fields I need to display are “Date,” “User ID,” Rating Scale (Likert) Learner Response," and “Text Box Learner Response.” the last two fields are found in the details field. Is it possible to create a Google Sheet only containing the fields I listed? I attached a copy of the Google Sheet for reference. If you need anything else, please let me know.

Thank you,

Hi James,

Please check my answer in this thread Google Sheet Survey Results Question.