Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!