首页 > 解决方案 > Google Firebase Cloud Functions 添加新的 Google 表格选项卡

问题描述

我正在尝试通过 Typescript 使用 Firebase Cloud Functions 在 Google 表格中添加一个新的“表格”选项卡。我使用教程 https://gist.github.com/CodingDoug/ffc4f050cc489a0280eb7f4cbe36af07作为参考。下面的代码显示了我希望它如何工作的示例。我怎样才能做到这一点,以便我可以使用 Firebase Cloud Functions 在 Google 表格中“创建”一个新的“表格”选项卡?

let values = [
        [
         'exampleData11','exampleData12'
        ], [
         'exampleData21','exampleData22'
        ], 
        //...
    ];

    const resource = {
        values,
    };

    await authPromise
    await sheets.spreadsheets.values.update({
        auth: auth,
        spreadsheetId: spreadsheetId,
        // add sheet named 'exampleSheet'
        range: 'exampleSheet',
        valueInputOption: 'RAW',
        resource,
    })

标签: typescriptfirebasefirebase-realtime-databasegoogle-cloud-functionsgoogle-sheets-api

解决方案


推荐阅读