Google Sheet Api get function returning undefined value in nodejs

后端 未结 1 2007
耶瑟儿~
耶瑟儿~ 2021-01-06 14:17
function changeData(auth,sheetId) {
  var sheets = google.sheets(\'v4\');
  sheets.spreadsheets.values.update({
    auth: auth,
    spreadsheetId: sheetId,
    range         


        
相关标签:
1条回答
  • 2021-01-06 14:36

    If you are using googleapis after the version of v26.0.1 (now it's 32.0.0.), in your script, you can retrieve the data by result.data. So how about the following modification?

    From :

    var numRows = result.values ? result.values.length : 0;
    

    To :

    var numRows = result.data.values ? result.data.values.length : 0;
    
    0 讨论(0)
提交回复
热议问题