How to use the sheets function from googleapis

Find comprehensive JavaScript googleapis.sheets code examples handpicked from public code repositorys.

48
49
50
51
52
53
54
55
56
57
function GetSpreadsheetID() {
    // Reading from a file was not working correctly for some reason.
    return Promise.resolve('1Rg7K7F4y4PL4LPvB32kKRb6FEd8uV5hOkSa0rcnkDWM');
}
function AppendRow() {
    var gSheets = GoogleApis.sheets('v4');

    gSheets.spreadsheets.values.append({
        auth: globalData.gAPIAuthClient,
        spreadsheetId: globalData.spreadsheetID,
fork icon0
star icon3
watch icon10

9
10
11
12
13
14
15
16
17
18
import { Logger } from '../utils/logger';
const logger = Logger.getInstance();

async function getRange(auth: Oauth2Client, range: number, spreadsheetId: string): Promise<Array<GSheetsValuesToAppend>> {
  try {
    const sheets = google.sheets('v4');
    const response = await promisify(sheets.spreadsheets.values.get)({
      auth: auth,
      spreadsheetId: spreadsheetId,
      range: range
fork icon74
star icon0
watch icon2

+ 3 other calls in file

8
9
10
11
12
13
14
15
16
17
18
moment.suppressDeprecationWarnings = true; // removing those Deprecation Warnings that aren't relavant


module.exports = {
  getDetails: async (req, res) => {
    const auth = await authentication.authenticate();
    const sheets = google.sheets("v4");
    const getValues = promisify(sheets.spreadsheets.values.get);
    try {
      const response = await getValues({
        auth,
fork icon0
star icon0
watch icon1