1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

FileMakerとGoogleカレンダーの連携

Last updated at Posted at 2018-10-03

Google Apps Script を作成する

function doPost(e){  
  var api_key="filemaker";

  // 上記のapi_keyとparameterのapi_keyが一致していたら
  if (api_key === e.parameter.api_key) {
    //カレンダーを取得
    var calendar = CalendarApp.getCalendarsByName(e.parameter.calendarName)[0];
    
    //イベント作成に必要な値をパラメータから設定
    var title = e.parameter.title;
    var date = new Date(e.parameter.date);
    var option = {
      description: e.parameter.description,
      location: e.parameter.location
    }
    
    //イベントを作成する
    var result = calendar.createAllDayEvent(title,date,option); 
    
    //作成したイベントのidを取得する
    var res = result.getId();
    
    //上記で取得したイベントIDを呼び出し元に返す
    return ContentService.createTextOutput(res).setMimeType(ContentService.MimeType.TEXT);
  }

}

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?