0
0

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.

【質問】Slack slash command→Driveでのフォルダ作成の仕方【GAS】

Posted at

Slack slash command→Driveでのフォルダ作成

初心者です。
slack slash command で Drive内でフォルダを作成したいです。
それぞれのFunction (doPost, createFolder)は動くのですが
二つ並べて書いてコマンドを入力してもコメントが反映されるだけで
フォルダが作成されません。

プログラミング初心者なので根本的なところが間違っているのかと思うのですが
ご教授いただければ幸いです。

現在のコード

function doPost(e) {
return ContentService.createTextOutput("新しいフォルダを作成しました");}

function createFolder() {
var folder = DriveApp.getFolderById("**************");
var args1 = ["new"];
var args2 = ["01","02","03","04"];
var folder1 = [];

for (var i = 0; i < args1.length; i++){
folder1[i] = folder.createFolder(args1[i]);
}

for (var i = 0; i < args2.length; i++){
folder1[0].createFolder(args2[i]);
}
}

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?