回答編集履歴

2

 

2022/07/09 06:09

投稿

退会済みユーザー
test CHANGED
@@ -3,8 +3,10 @@
3
3
  getValues/setValuesを使用してください。
4
4
  ```js
5
5
 
6
+ //メッセージID列(F列の2行目~データのある最終行まで)を一次元配列として取得=Arrayオブジェクト.flat(深さ)//
7
+ const lastRow = sheet.getLastRow();
6
- const ids = sheet.getRange(2, 6, lastRow).getValues().flat();
8
+ const ids = sheet.getRange(2, 6, lastRow).getValues().flat();
7
-
9
+
8
10
  if(array.length > 0){
9
11
  sheet.getRange(lastRow + 1, 1, array.length, array[0].length).getValues(array);
10
12
  }

1

  

2022/07/09 06:08

投稿

退会済みユーザー
test CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  getValues/setValuesを使用してください。
4
4
  ```js
5
+
5
6
  const ids = sheet.getRange(2, 6, lastRow).getValues().flat();
6
7
 
8
+ if(array.length > 0){
7
- sheet.getRange(lastRow + 1, 1, array.length, array[0].length).getValues(array);
9
+ sheet.getRange(lastRow + 1, 1, array.length, array[0].length).getValues(array);
10
+ }
8
11
  ```
12
+ (動作確認はしていませんので他の部分に誤りがあったとしても関知しません)
9
13
 
10
-