Google spreadsheet reading parameters from its own URL

后端 未结 2 441
庸人自扰
庸人自扰 2021-01-25 00:03

I would like to open a Google Spreadsheet with a few parameters.

Can I add these few parameters in the URL to open the spreadsheet, and then in the spreadsheet load thes

2条回答
  •  逝去的感伤
    2021-01-25 00:06

    Here is a table of triggers that are available to the different Google Products:

    Available Types of Triggers

    In a Stand Alone app, you can run a doGet() function. The doGet() function runs automatically. There is an e.parameter option available to doGet(e) that will parse URL search string settings. But a doGet() function can't be added to a Sheet.

    The URL parameters that are available are listed in this documentation:

    URL Parameters

    But, those URL Parameters are for Web Apps and Google Sites Gadgets, not for a Google Sheet.

    You could have an intermediary Google Apps Script that you send the URL Request to, and then the Apps Script processes the URL Search String parameters, and then opens up the spreadsheet.

    So, instead of using the Google Sheet URL to open the spreadsheet, you'd be using a URL of the deployed web app. Then the user would need to click a link to open the spreadsheet.

    Once the web app parsed the URL Search string values, you would need to write some kind of script that did something like write those values into your spreadsheet using the Spreadsheet Service

提交回复
热议问题