Create link for editing Google forms

21 views
Skip to first unread message

Leen Hoefnagels

unread,
Jun 22, 2022, 3:09:49 AM6/22/22
to Google Apps Script Community
Hi

I have made an app script but there is something wrong in my code... can someone help me please? Apparently there is something wrong in de "bold" line.

Thx
Leen

Code:

function assignEditUrls() {
  var form = FormApp.openById("1vP-EHqBIR0PckUD-PVzv-g3q9LPrJokNzwAxT3Z8UUU");

  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Formulierreacties 1");

  var data = sheet.getDataRange().getValues();

  var urlCol = 144;

  var reacties = form.getResponses();

  var timestamps = []; UrLs = []; resultUrls = [];

for (var i = 0; i < reacties.lengte; i++) {

timestamps.push(antwoorden)[i].getTimestamp().setMilliseconds(0);

urls.push(antwoorden)[i].getEditResponseUrl();

}

for (var j = 1; j < data.length; j++) {

resultUrls.push([data[j][0] ?urls[timestamps.indexOf(data[j][0].setMilliseconden(0))]:""]);

}

sheet.getRange(2, urlCol, resultUrls.length).setValues(resultUrls);

}

Jonathan Butler

unread,
Jun 22, 2022, 9:14:01 AM6/22/22
to google-apps-sc...@googlegroups.com
UrLs and urls are not the same. Defining variables are case sensitive. Change UrLs to urls.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ddced4f1-cb23-49e9-8117-4d730166a726n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages