I want to use Google Apps Script to edit a response to a form that has already been submitted. I have the id of the answer and I can retrieve it, but I cannot send it again changing any item:
var libro = SpreadsheetApp.getActiveSpreadsheet()
var hoja = libro.getSheetByName('Respuestas de formulario 1')
const answers = hoja.getRange(1,1,hoja.getLastRow(), hoja.getLastColumn()).getValues().slice(2)
const form = FormApp.openById(FORM_ID);
var cuestionario = form.getResponse(RESPONSE_ID)
const items = form.getItems();
cuestionario.withItemResponse(items[0].asListItem().createResponse(answers[1][1])) //competición
.withItemResponse(items[1].asListItem().createResponse(answers[1][2])) //sección
.withItemResponse(items[2].asTextItem().createResponse(answers[1][3])) //Equipo Sección
.withItemResponse(items[3].asTextItem().createResponse(answers[1][4])) //Equipo A
.withItemResponse(items[4].asTextItem().createResponse(answers[1][5])) //Equipo B
.withItemResponse(items[5].asDateItem().createResponse(answers[1][6])) //Fecha Inicial
.withItemResponse(items[6].asDateItem().createResponse(answers[1][7])) //Fecha Juego
.withItemResponse(items[7].asDateItem().createResponse(answers[1][8])) //Hora
.withItemResponse(items[8].asTextItem().createResponse(answers[1][9])) //Campo
.withItemResponse(items[9].asTextItem().createResponse(answers[1][10])) //Entrenador
.withItemResponse(items[10].asTextItem().createResponse(answers[1][11])) //Categoría Fab
.withItemResponse(items[11].asListItem().createResponse(answers[1][12])) //Pista Colegio
cuestionario.submit()
Exception: Lo sentimos. Esta respuesta ya se ha enviado
Exception: Sorry. This reply has already been sent