We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, use sheets.spreadsheets.batchUpdate. It is not atomic operation. So, It can not write concurrently.
sheets.spreadsheets.batchUpdate
sheets.spreadsheets.values.append is atomic operation.
sheets.spreadsheets.values.append
However, sheets.spreadsheets.values.append can not write with format. It only writes values.
// append is atomic // batchUpdate is not atomic // https://groups.google.com/g/google-spreadsheets-api/c/G0sUsBHlaZg const foundSheetTitle = foundSheet?.properties?.title!; return sheets.spreadsheets.values.append({ oauth_token: token, spreadsheetId: meta.spreadsheetId, valueInputOption: 'USER_ENTERED', insertDataOption: "INSERT_ROWS", range: `${foundSheetTitle}!A:A`, requestBody: { values: [ [ item.date, item.to, item.amount, item.url, item.memo, JSON.stringify(item.meta ?? {}) ].map((v) => { if (typeof v === "number") { const shouldTransformCurrency = item.currency.from !== item.currency.to; if (shouldTransformCurrency) { const date = dayjs(item.date).format("YYYY/MM/DD"); // price * finance rate const value = `= ${v} * index(GOOGLEFINANCE("CURRENCY:${item.currency.from}${item.currency.to}", "price", "${date}"), 2, 2)`; return value; } else { return v; } } return v; }) ] } });
This is no problem with the application layer. However, a spreadsheet can not show numbers as currency.
https://stackoverflow.com/questions/42696248/how-to-append-and-format-row-at-same-time-google-sheet-api
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, use
sheets.spreadsheets.batchUpdate
. It is not atomic operation.So, It can not write concurrently.
sheets.spreadsheets.values.append
is atomic operation.However,
sheets.spreadsheets.values.append
can not write with format.It only writes values.
This is no problem with the application layer.
However, a spreadsheet can not show numbers as currency.
https://stackoverflow.com/questions/42696248/how-to-append-and-format-row-at-same-time-google-sheet-api
The text was updated successfully, but these errors were encountered: