AppSheetでファイル生成したい人は多いでしょう。今回は、AppSheetでエクセルやPDFファイルを新規作成する方法の記事を書きます。これでファイル生成アプリを作ることができます。
AppSheetで作成ファイルの設定を行う
無料プランであっても、ファイルを作成できる点がAppSheetの優れた点です。その手順を説明します。
①AutomationのTasksを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-129.png)
②下のウィンドウのNew Taskを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-130.png)
③Task categoryのCreate a new fileを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-131.png)
④Templateの右のCreateボタンを押します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-132.png)
⑤Templateの欄に文字が表示されます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-133.png)
⑥Template右側のViewボタンを押します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-135.png)
AppSheetで作成するファイルの設定を決める
①Googleドキュメントが開きます。これが作成されるファイルフォーマットです。<<[***]>>で表示されている項目がAppSheetのColmunの値で可変値になります。
![](https://aoi345.com/wp-content/uploads/2023/08/image-136.png)
②DataメニューのColumnsのタブを選びます。そしてトリガというNameのデータをNumberというTYPEで用意しておきます。(Googleスプレッドシートで値を用意します)
![](https://aoi345.com/wp-content/uploads/2023/08/image-139.png)
③AutomationのEventsタブに戻ります。
![](https://aoi345.com/wp-content/uploads/2023/08/image-137.png)
④Eventsの中のNew Eventを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-138.png)
⑤New Eventが開きますので、Conditionのテキストエリアを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-140-1024x593.png)
⑥Expression Assistantウィンドウが開くので、下記の式を入れてSaveを押します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-141-1024x735.png)
⑦ここで右上のSAVEを押しておきます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-142.png)
⑧Botsタブを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-143-1024x598.png)
⑨BotsタブメニューのNew Botを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-144-1024x586.png)
⑩Create a custom botを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-145.png)
⑪EVENTのConfigure eventとPROCESSのAdd a stepを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-146-1024x515.png)
⑫下記のように今までのステップで作成した「New Event」と「New Task」を設定します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-147.png)
AppSheetのファイル作成をボタン操作で実行する
①最後にBehaviorメニューを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-148.png)
②初期選択のActionsタブのNew Actionを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-149.png)
③Add a new actionウィンドウの左下のCreate a new actionを選びます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-150.png)
④作成されるNew ActionのSet these columnsの設定を行います。
![](https://aoi345.com/wp-content/uploads/2023/08/image-151.png)
⑤トリガ、[トリガ]+1と下記のように設定します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-152.png)
⑥右上のSAVEボタンを押します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-153.png)
以上でサンプルの作成が完了です。
実際にテストしてみます。
いずれかの項目を選ぶとNew Actionボタンが表示されますので、押します。
![](https://aoi345.com/wp-content/uploads/2023/08/image-154-1024x322.png)
ボタンを押すとGoogleドライブのFilesフォルダにPDFファイルが保存されます。エクセルファイルなども作成可能です。
![](https://aoi345.com/wp-content/uploads/2023/08/image-155.png)
PDFを開くと、下記のようにTemplate設定で作成した内容が表示されます。
![](https://aoi345.com/wp-content/uploads/2023/08/image-156.png)
![](https://aoi345.com/wp-content/plugins/pochipp/assets/img/pochipp-logo-t1.png)
まとめ
今回は、AppSheetでエクセルやPDFファイルを新規作成する方法についての記事を書きました。ポイントをまとめると下記の通りとなります。
- AppSheetはPDFやエクセルなどのファイルの生成ができる
- AutomationのTaskに新規ファイル作成の機能がある
- ボタンとファイル生成の連動にはトリガを利用する
つまり、ファイル生成アプリ作成にはAppSheetがおすすめです。そのため、ファイルフォーマットを準備しましょう!
AppSheetに興味がある人は、下記の記事もチェックしてください。
![](https://aoi345.com/wp-content/uploads/2023/08/8aa09ea6d7822fbb10331635d428d488-300x300.png)