Google App Script




                                       Aakash Goel
                                  http://gplus.to/aakashg



          Don't Hate, Automate!
Raise your hand




                    Ever heard of
                  Google App Script?

                    Google Docs???

                     Who uses
                    Google Drive?




                             © Copyright GDG BVP 2012
Agenda


  Is Apps Script for you?

  Features of Apps Script Services
  o Docs Services
  o Mail, Calendar, Contacts
  o Integration Services
  o UI Services
  o Utilities & Debugger

  Demos

  Getting Started




                                     © Copyright GDG BVP 2012
WHAT is App Script?


   JavaScript engine in the cloud
      o JavaScript Runtime
      o Execute on Google's cloud
      o Integrates with Google's Services

   Comes with
      o    JavaScript syntax and base classes
      o   Built-in access to various Google APIs
      o   Ability to integrate 3rd party services
      o   Online editor: Write code in the browser




                                                     © Copyright GDG BVP 2012
WHY App Script?




                         Easy to Use
                         o Write on the web, run on the web
                         o No hardware, software,
                           deployments, maintenance etc..
                         o JavaScript syntax




 Don't hate, Automate!
                                             © Copyright GDG BVP 2012
WHERE is App Script?


   Executed in a variety of different ways
    o Spreadsheet
    o Google Sites
    o Standalone with Custom UI
    o Asynchronous Triggers




                                             © Copyright GDG BVP 2012
WHO can use App Script?



             Anyone CAN SCRIPT!




                                  © Copyright GDG BVP 2012
WHO can use App Script?




                          © Copyright GDG BVP 2012
App Script Services


  Google products
   o Spreadsheet
   o Sites
   o DocList

   o Gmail
   o Contacts
   o Calendar

   o Maps
   o Finance
      ...



                      © Copyright GDG BVP 2012
App Script Services


  External services
   o   URL Fetch + OAuth
   o   JDBC
   o   SOAP
   o   XML


  Other
   o UI Services
   o WYSIWYG Editor
   o Charts




                           © Copyright GDG BVP 2012
Triggers


  Triggers allow asynchronous execution of scripts


  Types of Triggers:
  o Event Driven
  o Time Driven


  Advantage:
  Helps in Automation




                                                     © Copyright GDG BVP 2012
Demos


 Save Gmail attachment automatically to Drive
                goo.gl/YLm2W

 MCQ tests: email score & correction

 Drive Eye

 Flubaroo




                                                © Copyright GDG BVP 2012
Need a Break??


             © Copyright GDG BVP 2012
Getting Started




                  © Copyright GDG BVP 2012
Hello World


function myFunction() {

    // Create a new document with the title 'Hello World'
    var doc = DocumentApp.create('Hello World');

    // Add a paragraph to the document
    doc.appendParagraph('This document was created by my first Google Apps Script.');

    // Save and close the document
    doc.saveAndClose();

}




                                                                          © Copyright GDG BVP 2012
Hello World


function myFunction() {
    …

// Get the URL of the document
  var url = doc.getUrl();

    // Get the email address of the active user - that's you
    var emailAddress = Session.getActiveUser().getEmail();

    // Send yourself an email with a link to the document
    GmailApp.sendEmail(emailAddress, “Hello World', ‘Link to a document created by my ' +
                'first Google Apps Script: ' + url);
}




                                                                           © Copyright GDG BVP 2012
Custom Spreadsheet Function


function c2f(inp) {

    // Function to convert from Celsius to Fahrenheit.
    var out = 0; // this will hold the answer

if (typeof inp != "number") { // check to make sure the input is a number
   throw "Input value must be a number"; // throw an exception with the error message
 }

    out = (inp*9)/5 + 32; // calculate the answer
    return out; // return the answer to the cell which has the formula

}




                                                                         © Copyright GDG BVP 2012
Calendar Event


function myFunction() {
//Create an object of the Default calender in use.
    var calender = CalendarApp.getDefaultCalendar();
//startDate will correspond to the current date and time.
     var startDate = new Date();
//endDate will be same as the startDate.
    var endDate = new Date(startDate);
//Increment the hours of endDate by 2 as the duration of the event is 2 hrs.
     endDate.setHours(startDate.getHours() + 2);
//Create the Event.
    var event = calender.createEvent("Hackathon", startDate, endDate);
}




                                                                           © Copyright GDG BVP 2012
Contact Me


   Google Plus
   http://gplus.to/aakashg

   Twitter
   @goelaakash9

   Email Id
   gscript.bvp@gmail.com




                             © Copyright GDG BVP 2012
Feedback




            Feedback Form
           http://goo.gl/jLzWu




                                 © Copyright GDG BVP 2012

More Related Content

PDF
App script
PDF
Google apps script introduction
PDF
Using Google (Cloud) APIs
PDF
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
PDF
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
PPTX
GWTcon 2015 - Best development practices for GWT web applications
PPTX
Grails Plugin
PDF
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
App script
Google apps script introduction
Using Google (Cloud) APIs
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides, Apps Scri...
20210411 全端網頁開發起手式:建構並佈署Angular網頁應用程式至GCP
GWTcon 2015 - Best development practices for GWT web applications
Grails Plugin
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源

What's hot (20)

PDF
G Suite & Google APIs coding workshop
PDF
Introducing GWT Polymer (vaadin)
PPT
Grails Connecting to MySQL
ODP
Desktop Summit 2011 Talk
PDF
Getting started using Google APIs (2019)
PPTX
Google Map Code
PPTX
Learning Svelte
PDF
Firebase analytics event_201607
PPTX
Access google command list from the command line
PDF
Big query - Command line tools and Tips - (MOSG)
PDF
Web view
PDF
GLSL: Releasing the power of the GPU
KEY
Making Django and NoSQL Play Nice
PDF
Google App Engine Developer - Day1
PDF
Google Apps Script: Accessing G Suite & other Google services with JavaScript
PPTX
GvaScript Library
PDF
Serverless Angular, Material, Firebase and Google Cloud applications
PPTX
MeteorJS Meetup
PDF
Exploring Google APIs with Python
PPTX
Jump into React-Native (Class 2/6)
G Suite & Google APIs coding workshop
Introducing GWT Polymer (vaadin)
Grails Connecting to MySQL
Desktop Summit 2011 Talk
Getting started using Google APIs (2019)
Google Map Code
Learning Svelte
Firebase analytics event_201607
Access google command list from the command line
Big query - Command line tools and Tips - (MOSG)
Web view
GLSL: Releasing the power of the GPU
Making Django and NoSQL Play Nice
Google App Engine Developer - Day1
Google Apps Script: Accessing G Suite & other Google services with JavaScript
GvaScript Library
Serverless Angular, Material, Firebase and Google Cloud applications
MeteorJS Meetup
Exploring Google APIs with Python
Jump into React-Native (Class 2/6)
Ad

Similar to GAS Session (20)

PPTX
GCCP.pptx
PDF
Building Translate on Glass
PPTX
GCCP Session #1 - Getting Started with GCP.pptx
PDF
Introduction to Google Cloud Endpoints: Speed Up Your API Development
PDF
Exploring Google (Cloud) APIs & Cloud Computing overview
PDF
Introductory Session.pdf
PPTX
Copy of Week #1
PPTX
Session #1 GCCP
PPTX
Google AppEngine and Cloud Endpoint
PPTX
Introduction to GCCP - 2022.pptx
PDF
Accessing Google Cloud APIs
PPTX
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
PPTX
Week #1 Training ACEM.pptx
PDF
Google Apps Script: Accessing G Suite & other Google services with JavaScript
PPTX
Week #1 Training.pptx
PDF
Introduction to Cloud Computing with Google Cloud
PDF
Introduction to serverless computing on Google Cloud
PDF
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
PDF
Exploring Google APIs with Python
PDF
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
GCCP.pptx
Building Translate on Glass
GCCP Session #1 - Getting Started with GCP.pptx
Introduction to Google Cloud Endpoints: Speed Up Your API Development
Exploring Google (Cloud) APIs & Cloud Computing overview
Introductory Session.pdf
Copy of Week #1
Session #1 GCCP
Google AppEngine and Cloud Endpoint
Introduction to GCCP - 2022.pptx
Accessing Google Cloud APIs
Deploy Your Website with GCP Workshop slides of GDG on Campus UNSTPB
Week #1 Training ACEM.pptx
Google Apps Script: Accessing G Suite & other Google services with JavaScript
Week #1 Training.pptx
Introduction to Cloud Computing with Google Cloud
Introduction to serverless computing on Google Cloud
Google Technical Webinar - Building Mashups with Google Apps and SAP, using S...
Exploring Google APIs with Python
#MBLTdev: Разработка backend для мобильного приложения с использованием Googl...
Ad

Recently uploaded (20)

PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
Virtual and Augmented Reality in Current Scenario
PDF
advance database management system book.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
Uderstanding digital marketing and marketing stratergie for engaging the digi...
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
IGGE1 Understanding the Self1234567891011
PDF
Trump Administration's workforce development strategy
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Introduction to pro and eukaryotes and differences.pptx
Virtual and Augmented Reality in Current Scenario
advance database management system book.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
History, Philosophy and sociology of education (1).pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Share_Module_2_Power_conflict_and_negotiation.pptx
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
What if we spent less time fighting change, and more time building what’s rig...
FORM 1 BIOLOGY MIND MAPS and their schemes
Uderstanding digital marketing and marketing stratergie for engaging the digi...
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Hazard Identification & Risk Assessment .pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
B.Sc. DS Unit 2 Software Engineering.pptx
IGGE1 Understanding the Self1234567891011
Trump Administration's workforce development strategy
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx

GAS Session

  • 1. Google App Script Aakash Goel http://gplus.to/aakashg Don't Hate, Automate!
  • 2. Raise your hand Ever heard of Google App Script? Google Docs??? Who uses Google Drive? © Copyright GDG BVP 2012
  • 3. Agenda Is Apps Script for you? Features of Apps Script Services o Docs Services o Mail, Calendar, Contacts o Integration Services o UI Services o Utilities & Debugger Demos Getting Started © Copyright GDG BVP 2012
  • 4. WHAT is App Script? JavaScript engine in the cloud o JavaScript Runtime o Execute on Google's cloud o Integrates with Google's Services Comes with o JavaScript syntax and base classes o Built-in access to various Google APIs o Ability to integrate 3rd party services o Online editor: Write code in the browser © Copyright GDG BVP 2012
  • 5. WHY App Script? Easy to Use o Write on the web, run on the web o No hardware, software, deployments, maintenance etc.. o JavaScript syntax Don't hate, Automate! © Copyright GDG BVP 2012
  • 6. WHERE is App Script? Executed in a variety of different ways o Spreadsheet o Google Sites o Standalone with Custom UI o Asynchronous Triggers © Copyright GDG BVP 2012
  • 7. WHO can use App Script? Anyone CAN SCRIPT! © Copyright GDG BVP 2012
  • 8. WHO can use App Script? © Copyright GDG BVP 2012
  • 9. App Script Services Google products o Spreadsheet o Sites o DocList o Gmail o Contacts o Calendar o Maps o Finance ... © Copyright GDG BVP 2012
  • 10. App Script Services External services o URL Fetch + OAuth o JDBC o SOAP o XML Other o UI Services o WYSIWYG Editor o Charts © Copyright GDG BVP 2012
  • 11. Triggers Triggers allow asynchronous execution of scripts Types of Triggers: o Event Driven o Time Driven Advantage: Helps in Automation © Copyright GDG BVP 2012
  • 12. Demos Save Gmail attachment automatically to Drive goo.gl/YLm2W MCQ tests: email score & correction Drive Eye Flubaroo © Copyright GDG BVP 2012
  • 13. Need a Break?? © Copyright GDG BVP 2012
  • 14. Getting Started © Copyright GDG BVP 2012
  • 15. Hello World function myFunction() { // Create a new document with the title 'Hello World' var doc = DocumentApp.create('Hello World'); // Add a paragraph to the document doc.appendParagraph('This document was created by my first Google Apps Script.'); // Save and close the document doc.saveAndClose(); } © Copyright GDG BVP 2012
  • 16. Hello World function myFunction() { … // Get the URL of the document var url = doc.getUrl(); // Get the email address of the active user - that's you var emailAddress = Session.getActiveUser().getEmail(); // Send yourself an email with a link to the document GmailApp.sendEmail(emailAddress, “Hello World', ‘Link to a document created by my ' + 'first Google Apps Script: ' + url); } © Copyright GDG BVP 2012
  • 17. Custom Spreadsheet Function function c2f(inp) { // Function to convert from Celsius to Fahrenheit. var out = 0; // this will hold the answer if (typeof inp != "number") { // check to make sure the input is a number throw "Input value must be a number"; // throw an exception with the error message } out = (inp*9)/5 + 32; // calculate the answer return out; // return the answer to the cell which has the formula } © Copyright GDG BVP 2012
  • 18. Calendar Event function myFunction() { //Create an object of the Default calender in use. var calender = CalendarApp.getDefaultCalendar(); //startDate will correspond to the current date and time. var startDate = new Date(); //endDate will be same as the startDate. var endDate = new Date(startDate); //Increment the hours of endDate by 2 as the duration of the event is 2 hrs. endDate.setHours(startDate.getHours() + 2); //Create the Event. var event = calender.createEvent("Hackathon", startDate, endDate); } © Copyright GDG BVP 2012
  • 19. Contact Me Google Plus http://gplus.to/aakashg Twitter @goelaakash9 Email Id gscript.bvp@gmail.com © Copyright GDG BVP 2012
  • 20. Feedback Feedback Form http://goo.gl/jLzWu © Copyright GDG BVP 2012