theoephraim / node-google-spreadsheet

Google Sheets API wrapper for Javascript / Typescript
https://theoephraim.github.io/node-google-spreadsheet
The Unlicense
2.25k stars 382 forks source link

Question: How to force load cells? #681

Open Tiffceet opened 4 months ago

Tiffceet commented 4 months ago

Currently, using loadCells() will discard some columns if the first cell in the column is empty. Example below: image doing await sheet.loadCells('A1:C4'); would only load the first 2 columns. How do I force load all cells that I have specified to load?

Code:

await sheet.loadCells('A1:C4');
const sheetData = await sheet.getRows();
for (const row of sheetData) {
  console.log(row._rawData)
}

Output:

[ "ID", "NAME" ]
[ "1", "Name 1" ] // Missing "Other cells"
[ "1", "Name 1" ]
[ "1", "Name 1" ]
theoephraim commented 4 months ago

interesting, I'll have to check this out as it's definitely not the intended behaviour... thanks for reporting it!