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

206
Visualizações
Getting all sheets from multiple workbooks

I'm trying to return data from 40 different workbooks each with two sheets. For some reason when I log this return data value, I am only getting the information from one sheet. I think I need to make a 2D array but not sure. Any ideas?

//Function to pull all data from workbook
function getDataFromSpreadsheet(ssID) {

//Open workbook
var ss = SpreadsheetApp.openById(ssID);
//Get all sheets in workbook and put into array
var ws = ss.getSheets()[0];
//Get data in the open sheet
var data = ws.getRange("A4:C" + ws.getLastRow()).getValues();
return data;

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

0

Get Data from all sheets into a 2D array A4:C

function getDataFromSpreadsheet(ssID) {
  var ss = SpreadsheetApp.openByID('id');
  var data = ss.getSheets().map(sh => sh.getRange(4, 1, sh.getLastRow() - 3, 3).getValues()).flat(1);
  //Logger.log(JSON.stringify(data));
  return data;
}

flat

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