GASのスプレッドシートを触る
またしても権限を渡す必要がある(関数を実行するとダイアログが出るので従う)
https://gyazo.com/6159997cdd2cfd25a13531fa3ba2c741
セルのデータ取得
参考
スプレッドシートが
https://gyazo.com/6398fce4a1dfd77a3240dc00de882a65
とすると、
code:myfunction.js
const spreadSheet = SpreadsheetApp.openById('YOUR_ID');
const sheet = spreadSheet.getSheetByName('your_sheet');
Logger.log(sheet.getDataRange().getValues());
で表示されるログはこう
code:_
条件式
README的なやつ
シートに対してスクリプトを作用させるためには2つの方法がある
scriptに権限を与える
今回はこっちをやった
シートに対してbound scriptを使う
Spreadsheet serviceを使うと2次元配列としてsheetを利用することができる
To retrieve the data from the spreadsheet, you must get access to the spreadsheet where the data is stored, get the range in the spreadsheet that holds the data, and then get the values of the cells. Apps Script facilitates access to the data by reading structured data in the spreadsheet and creating JavaScript objects for them.
書き込み方法
セルの時刻操作
参考になりそうな資料
ハマり
列方向の捜査ができない
全部データを取得してしまってメモリ上で転置させるなどの工夫が必要
GASは手軽にnpmが使えないのでこのあたりの処理を真面目にやろうとするとダルそう