Upgrade to Pro — share decks privately, control downloads, hide ads and more …

QuickStartToGAS

gkzz
March 31, 2019

 QuickStartToGAS

overview of google apps script, tips of development, and sample codes

gkzz

March 31, 2019
Tweet

More Decks by gkzz

Other Decks in Programming

Transcript

  1. Quick Start To GAS Gakuji Tamaki Systems Developer APCommunications Co.,

    Ltd. Twitter: @gkzvoice, Github/Medium: @gkzz
  2. Table of Contents 1.About Me 2.Today’s Goal 3.Overview of Google

    Apps Script 4.Get Data From SpreadSheet 5.Post Data To Chat App 6.Appendix
  3. My Opinion: If you feel naming is difficult, split your

    functions/variables into the smaller ones.
  4. Table of Contents (Re:) 1.About Me 2.Today’s Goal 3.Overview of

    Google Apps Script 4.Get Data From SpreadSheet 5.Post Data To Chat App 6.Appendix
  5. 3.Overview of Google Apps Script - Cloud-based Application Development Platform

    - Based on JavaScript - Integrate Easily with Google/Third-Party Apps - Also Allows Scripts to Return HTML Source; Image: www.lucidchart.com Cf. My Sample Script’s URL
  6. Today’s BOT Workflow: - setUp - getData - Boolean (Any

    News?) True False - send “NoNews” - postNews Source; SpreadSheet: www.iconarchive.com, Slack: www.iosicongallery.com, Gmail: www.flaticon.com
  7. Table of Contents (Re:) 1.About Me 2.Today’s Goal 3.Overview of

    Google Apps Script 4.Get Data From SpreadSheet 5.Post Data To Chat App 6.Appendix Function 3 postOnly() Function 2 getData() Function 1 setUp()
  8. Table of Contents (Re:) 1.About Me 2.Today’s Goal 3.Overview of

    Google Apps Script 4.Get Data From SpreadSheet 5.Post Data To Chat App 6.Appendix Function 3 postOnly() Function 2 getData() Function 1 setUp()
  9. 5.Post Data To Chat App See A Demo Source; Demo:

    @gkzvoice Code: github.com/gkzz/gas-handson
  10. Source; sinap.jp 6.Appendix 1.Run Apps Script 2.Use Debugger 3.Add Libraries

    4.Get Incoming Webhook URL 5.Add BOT User 6.Change Permissions 7.Get userID through Tester 8. Deploy as Web App Using Slash Commands 9. All Sample Codes -mailDraft, getUserList, getChannelHistory, etc
  11. 3.Push “View” and “Logs” Button, See the Logged Output 1.Predict

    Value of Variable 2.Set Logger.log(“val: %s”, val), Run Script Develop & Debug 6-2.Appendix Use Debugger
  12. [19-03-30 21:36:23:487 JST] writeConts: 0.0 [19-03-30 21:36:23:488 JST] Successful! [19-03-30

    21:36:23:489 JST] i: 0.0 [19-03-30 21:36:23:489 JST] value: [Thu Mar 28 13:02:45 GMT+09:00 2019, [email protected], Gendo, NERV, Shinji, Eva1, Mankind’s greatest fear is Mankind itself., , , , , , , , , , Done] [19-03-30 21:36:23:490 JST] writeConts: 1.0 [19-03-30 21:36:23:490 JST] Successful! [19-03-30 21:36:23:491 JST] i: 1.0 [19-03-30 21:36:23:492 JST] value: [Fri Mar 29 13:02:45 GMT+09:00 2019, [email protected], Gendo, NERV, Shinji, Eva1, Mankind’s greatest fear is Mankind itself., , , , , , , , , , Done] [19-03-30 21:36:23:492 JST] writeConts: 2.0 [19-03-30 21:24:55:236 JST] valueRange.length: 8.0 [19-03-30 21:24:55:238 JST] Successful! [19-03-30 21:24:55:239 JST] i: 0.0 [19-03-30 21:24:55:240 JST] value: [Thu Mar 28 13:02:45 GMT+09:00 2019, [email protected], Gendo, NERV, Shinji, Eva1, Mankind’s greatest fear is Mankind itself., , , , , , , , , , Done] Source; 1st Code: devel-old/sendRichMsg.js, 2nd: topic-getValueRange/sendRichMsg.js
  13. 6-3.Appendix Add Libraries See A Demo Source; Demo: @gkzvoice Code:

    https://github.com/gkzz/gas-handson Moment.js library key; MHMchiX6c1bwSqGM1PZiW_PxhMjh3Sh48
  14. 6-9. All Sample Codes Go to the Following Github Page

    https://github.com/gkzz/gas-handson