Last active
October 10, 2022 08:16
-
-
Save PaulieScanlon/077f51fffa49cdaf7006d4ca501e436f to your computer and use it in GitHub Desktop.
Read and Update the Google Sheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
export default async function handler(req, res) { | |
... | |
try { | |
... | |
+ await doc.getInfo(); | |
+ const sheet = doc.sheetsByIndex[0]; | |
+ const rows = await sheet.getRows(); | |
+ const raw_data = rows[0]._rawData; | |
+ const header_values = rows[0]._sheet.headerValues; | |
+ const row_value = rows[0][id]; | |
+ | |
+ rows[0][id] = Number(row_value) + 1; | |
+ await rows[0].save(); | |
+ | |
... | |
} catch (error) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment