teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

a

2020/01/16 18:51

投稿

papinianus
papinianus

スコア12705

answer CHANGED
@@ -1,12 +1,19 @@
1
- まるに、はなんですか?
2
- タイトルもかえてください。
3
-
4
- B列が160より大きいとき、A列をログに出す、という仕様に変わったと理解してます。
5
-
6
-
7
1
  ```javascript
8
2
  function myFunction(){
9
- SpreadsheetApp.getActiveSpreadsheet().getSheetByName('就業時間').getDataRange().getValues().filter(function(e){return e[1]>160;}).forEach(function(e){Logger.log(e[0]);});
3
+ SpreadsheetApp.getActiveSpreadsheet().getSheetByName('就業時間').getDataRange().getValues().filter(function(e){return e[1]>161;}).forEach(function(e){Logger.log(e[0]); sendHttpPost(e[0]);});
10
4
  }
5
+ function sendHttpPost(content){
6
+ const token = "LINEトークン";
7
+ const options =
8
+ {
9
+ "method" : "post",
10
+ "payload" : "message=" + content,
11
+ "headers" : {"Authorization" : "Bearer "+ token}
11
12
 
13
+ };
14
+
15
+ UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options);
16
+ }
12
- ```
17
+ ```
18
+
19
+ 一度に両方できるようにしました。後生ですから、クローズしてください。