node-google-spreadsheet icon indicating copy to clipboard operation
node-google-spreadsheet copied to clipboard

Support for retrieving value from rows interface

Open chrisjensen opened this issue 4 years ago • 1 comments

Thanks for the library, it's been so useful. I love the Spreadsheet Rows interface for it's simplicity. But from time to time I need to drop down to the cell level to get the underlying value

(in my case, dates are a worry, because if someone flips the formatting on the spreadsheet from US to Euro date formats, the the script can get it's dates all messed up)

But when I encounter cases like that, it'd be nice not to have to pull out the rows code and replace it with cell lookups.

Would you consider supporting a pull request that added support for something like this?

eg

const rows = await sheet.getRowsAsCells();
console.log(rows[0].my_date.value);
console.log(rows[0].my_date.formattedValue);

chrisjensen avatar Apr 30 '20 22:04 chrisjensen

Hello! Sorry this took so long to respond. Certainly open to a PR. I haven't thought through the implications - it may be tricky... but maybe not! Feel free to investigate!

Maybe something simpler would be a method to get the cells from a single row? thoughts?

theoephraim avatar Aug 17 '20 07:08 theoephraim