Googleカレンダー API を使って勤務場所を取得したい(願望)
https://gyazo.com/06fcfeba622a8230b8dd20de00ffdac2
結論:現状無理そう
イベントの場所を取得するのは可能
https://gyazo.com/f040a68468f1f56444f3c52e518189ab
code:getCalendarEvents.js
const CALENDAR_ID = 'xxxx'; //カレンダーID
function getCalendarEvents() {
const calendar = CalendarApp.getCalendarById(CALENDAR_ID);
const startTime = new Date('2022/03/14 00:00:00');
const endTime = new Date('2022/03/15 00:00:00');
const events = calendar.getEvents(startTime, endTime);
for(const event of events){
const record = [
event.getTitle(),
event.getStartTime(),
event.getEndTime(),
event.getLocation() // 場所
];
Logger.log(record);
}
// 出力結果
Notion でGitHubやGoogleカレンダーのデータと同期できるようになるらしいのでこちらも見ておく
https://www.youtube.com/watch?v=8aFKrTTr7r0