Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
Script AppendRow at the top

I have this little code to insert data from a form to a specific sheet.

function grabarEnSheets(e) {
  //Conectarse con sheets
  const libro=SpreadsheetApp.openById("SheetID")
  const hoja=libro.getSheetByName("Patrol-Logs")
  
  //Traer respuestas
  const respuestaEnviada=e.response;
  const respuestas=respuestaEnviada.getItemResponses();
  const Nombre = respuestas[0].getResponse();
  const Dia = respuestas[1].getResponse();
  const Tiempo = respuestas[2].getResponse();
  const Evidencia = respuestas[3].getResponse();
  const Traje = respuestas[4].getResponse();

  //Campos nuevos
  var fecha=new Date();

//Guardar respuestas en sheets
hoja.appendRow([fecha,Nombre,Tiempo,Dia,Evidencia,Traje])
}

function darPermisos(){
  SpreadsheetApp.openById("sheetID")
  FormApp.getActiveForm();
}

And the appendRow adds the data at the bottom of the sheet. So what I need is to append all entry data from the form and skip the first and second table. enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

From your following replying in the comment,

I don't know how to make appendRow to start adding the data at the third file, and not at the bottom.

I thought that you might have wanted to append a data row to the 3rd tab on the Google Spreadsheet. If my understanding is correct, how about the following modification?

From:

hoja.appendRow([fecha,Nombre,Tiempo,Dia,Evidencia,Traje])

To:

libro.getSheets()[2].appendRow([fecha,Nombre,Tiempo,Dia,Evidencia,Traje]);
  • libro.getSheets()[2] means the 3rd tab on the active Spreadsheet.

  • If you want to use appendRow to the specific sheet, you can also use the following script using the sheet name.

      libro.getSheetByName("###SheetName###").appendRow([fecha,Nombre,Tiempo,Dia,Evidencia,Traje]);
    

Reference:

  • getSheets() of Class Spreadsheet
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda