Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20220706_Google Apps Scriptを実演で学ぶ~ GAS × Slack ~
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Apachan
July 06, 2022
Programming
1.6k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20220706_Google Apps Scriptを実演で学ぶ~ GAS × Slack ~
Apachan
July 06, 2022
More Decks by Apachan
See All by Apachan
20220428_実務で使える Google Apps Script ライブデモ勉強会#3
apachan
0
560
20211111_実務で使えるGASライブデモ勉強会#2
apachan
0
120
20210921_LT_RPAの現実
apachan
0
2.7k
20210827_RPA勉強会!Google Apps Talk~GASでGmail活用術~
apachan
0
10k
実務で使えるGASライブデモ勉強会
apachan
0
110
Other Decks in Programming
See All in Programming
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
1.8k
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
340
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
240
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.3k
スマート反転とウェブアクセシビリティ
camiha
0
210
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
6
1.9k
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
170
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
320
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
170
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
200
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
570
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
So, you think you're a good person
axbom
PRO
2
2.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
420
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
390
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
Transcript
2021/07/06 1 ※ 本内容は個人的な見解であり、所属する組織と関係ありません。 Google Apps Script を実演で学ぶ ~ GAS
× Slack ~ Block Kit Builderを使おう
自己紹介 あぱchan @ApachanHonpo 埼玉県戸田市 宮城県仙台市 業務効率化のお仕事 2 2021年 11月 WinActor
トーク 6ヵ月20kg減
執筆書籍 3 徹底解説 RPAツールWinActor導入 ・応用 完全ガイド 絶対失敗しない!ロボット1000体 導入してわかったRPA成功の秘訣 Google Apps
Script目的別リファ レンス実践サンプルコード付き 需要のある技術を中心に出版社に提案 第3版 2021/3 発売 第1版 2020/5 発売 第1版 2020/8 発売 Google Apps Script目的別リファ レンス実践サンプルコード付き 第2版 2022/5 新発売
主なイベント登壇 4 RPA Community Google Apps Script の特徴・利用のきっかけ 必要な情報をメールから取得する方法 TechStreet
vol.1 2021/07 vol.2 2021/11 vol.3 2022/04 2022/7/6 Google Apps Scriptを実演で学ぶ~「GAS×Slack」 &「GAS×Notion」~
テーマ 5 Block Kit Builderを使おう
6 Block Kit クリーンで一貫性のあるUIフレームワーク https://api.slack.com/block-kit
7 Block Kit Builder 画面操作でUIを作成 UI選択 UI反映 編集 ※ ワークスペースへのサインイン必須
8 今回のデモ ① Slackチャンネルに通知 GAS プロジェクト Slack チャンネル ② Slackチャンネルからの通信(参考)
9 ワークフロー① 難易度:易 Slackチャンネルに通知 GAS プロジェクト Slack チャンネル
10 Incoming Webhook パターン 利用可能プラン 説明 カスタムインテグレー ション 全プラン かんたんに設定できますが、現在Slack社より非推奨
とされています。 SlackApp 全プラン やや複雑ですが手順がわかれば利用自体は難しくあ りません。 ワークフロービルダー スタンダード以上 ※ フリープラン不 可 かんたんに設定できますが、フリープランでは利用 できません。テキストにメンションやハイパーリン ク文字列など入れることができません。 ※ レスポンスが必要な場合はAPI利用
11 Slack App https://api.slack.com/apps Webhook URLの取得 ※ 無償版のアプリ作成は10個迄
12 Let’s Try
13 前提 function sendSlackMessage_ (url, data) { const params =
{ method: 'post', contentType: 'application/json' , payload: JSON.stringify(data) }; const res = UrlFetchApp.fetch(url, params); return res; } スクリプトプロパティの活用 Slack通知処理の分割
14 コーディング const PROPS = PropertiesService.getScriptProperties(); function gasToSlack() { const
webhook = PROPS.getProperty('webhook'); console.log(webhook); const data = { // Bloclk Kit コード 貼り付け }; const response = sendSlackMessage_(webhook, data); Logger.log(response); } スクリプトプロパティ Slack通知処理の分割
Slack チャンネル 15 ワークフロー➁ 難易度:中~高 Slackチャンネルからの通信 GAS プロジェクト デプロイなど各種設定、 doPost()、GCP...など
Block Kit 16 勤怠アプリ
17 GAS側 Webアプリ HTTPリクエストの取得 発動する関数 doPost(e)
18 Slack側 エンドポイント SlackからGASの通信設定
Code Slackからのリクエスト取得 19 function doPost(e) { console.log(e); Logger.log(e); // 意図的にエラー
宣言してない変数 name }
ログの比較 20 GAS GCP 何もなし ログ参照
Code シートへの書き出し 21 function doPost(e) { const payload = JSON.parse(e['parameter']['payload']);
const ssId = PROPS.getProperty('SSID'); const sh = SpreadsheetApp.openById(ssId).getSheets()[0]; sh.appendRow([payload]); }
Demo 22
課題のまとめ 23 ① doPost(e) GASのプロジェクトからログが参照できません GCPに連携してロギングを参照するか、スプレッドシートなどに書き出す必要あり ② JSON解析 階層が深い...リファレンスを見た方が良いのかも... ③
デプロイ Slackからの通信のため「テストのデプロイ」が利用できません コードが変わる度にデプロイの必要あり ④ 非同期通信 UI入力毎に通信が走る おそらく同期処理にできるはず... ⑤ 例外処理の設定 想定外のリクエストの処理
① doPost(e) GCPのロギング 24 ログの参照
② JSON解析 e['parameter']['payload'] 25 登録ボタンの判定 ユーザーの取得 入力内容の取得
Appendix 26
27 Google Slides
End Of File 28