回答編集履歴
3
エラー防止の修正
answer
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
// プロパティから値を取得する関数
|
9
9
|
function getDataValue(item) {
|
10
10
|
switch (item.type) {
|
11
|
-
case 'title': return item.title[0].plain_text;
|
11
|
+
case 'title': return item.title[0] ? item.title[0].plain_text : null;
|
12
|
-
case 'rich_text': return item.rich_text[0].plain_text;
|
12
|
+
case 'rich_text': return item.rich_text[0] ? item.rich_text[0].plain_text : null;
|
13
13
|
case 'number': return item.number;
|
14
14
|
case 'email': return item.email;
|
15
|
-
case 'date': return item.date.start;
|
15
|
+
case 'date': return item.date ? item.date.start : null;
|
16
|
-
case 'status': return item.status.name;
|
16
|
+
case 'status': return item.status ? item.status.name : null;
|
17
|
-
case 'select': return item.select.name;
|
17
|
+
case 'select': return item.select ? item.select.name : null;
|
18
18
|
case 'checkbox': return item.checkbox;
|
19
19
|
case 'url' : return item.url;
|
20
20
|
}
|
2
データ取得関数のデータの種類を増やしました。
answer
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
case 'status': return item.status.name;
|
17
17
|
case 'select': return item.select.name;
|
18
18
|
case 'checkbox': return item.checkbox;
|
19
|
+
case 'url' : return item.url;
|
19
20
|
}
|
20
21
|
}
|
21
22
|
```
|
1
fetchNotionData関数のコードの修正を明確にしました。
answer
CHANGED
@@ -58,4 +58,17 @@
|
|
58
58
|
|
59
59
|
なお、
|
60
60
|
**fetchNotionData**関数については、
|
61
|
-
コメントで質問したとおり**get**を**post**に修正し
|
61
|
+
コメントで質問したとおり**get**を**post**に修正し、
|
62
|
+
最後の } の前の行に**return data**を挿入し
|
63
|
+
|
64
|
+
```Javascript
|
65
|
+
'method': 'post',
|
66
|
+
```
|
67
|
+
と
|
68
|
+
```Javascript
|
69
|
+
Logger.log('レスポンス内容: ' + response.getContentText());
|
70
|
+
}
|
71
|
+
return data;
|
72
|
+
}
|
73
|
+
```
|
74
|
+
のようにします。
|