SlideShare a Scribd company logo
4
Solution 2 – Google Apps Script  Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services. http://code.google.com/googleapps/appsscript/ http://mashe.hawksey.info
Most read
6
How you write it In Spreadsheets Tools > Script Editor In Sites Manage Site > Apps Script http://mashe.hawksey.info
Most read
13
Pseudo-code     // onFormSubmit // get submitted data   // check if username has sheet   //    if not make   // copy submitted data to user's sheet  http://mashe.hawksey.info
Most read
Introduction to Google Apps Script On form submit filter data to sheets Martin Hawksey @mhawksey
The Problem Hi there, I'm trying to get some student PT's to complete a training diary using a Google form. I would like the form to automatically create a new sheet for each user.  I should ultimately have 42 entries per user/sheet. http://www.google.com/support/forum/p/Google+Docs/thread?tid=6fe8356595e9b859&hl=en http://mashe.hawksey.info
Solution 1 -  Filter the data http://mashe.hawksey.info
Solution 2 – Google Apps Script  Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services. http://code.google.com/googleapps/appsscript/ http://mashe.hawksey.info
How I see it http://mashe.hawksey.info
How you write it In Spreadsheets Tools > Script Editor In Sites Manage Site > Apps Script http://mashe.hawksey.info
How does the user interact with it In Spreadsheets In Sites As a service http://mashe.hawksey.info
There’s good and bad news Bad news You need basic programming skills to write Good news Already a growing number of developers publishing scripts and tutorials for you to reuse e.g.  http://www.flubaroo.com/ http://mashe.hawksey.info
Lets do it https://spreadsheets.google.com/a/hawksey.info/spreadsheet/ccc?key=0Alq6_NgDnxLWdENvZHhwVm93TjRhTm5fcjU0X0t3Vnc   Logins:  [email_address] [email_address]   … [email_address] Password:  ******* http://mashe.hawksey.info
Explanation of Javascript Objects got by getValues() data = [[“Dog”,”Cat”,”Cow”],[22, 31, 15],[6, 5, 5]] data[0] = [“Dog”,”Cat”,”Cow”] data[0][1] = “Cat” http://mashe.hawksey.info Dog Cat Cow 22 31 15 6 5 5
Useful links Workshop material from Open4Ed http://mashe.hawksey.info/2011/05/app-app-and-away-workshop-handout-open4ed-gas/ Simple Apps Solutions (free Apps Script consultancy for Ed and tutorials) http://simpleappssolutions.com   Official Apps Script Site Docs Tutorials Help forum http://mashe.hawksey.info
Not forgetting your friendly EdTech explorer Email: martin@hawksey.info Blog:  http://mashe.hawksey.info Tweet: @mhawksey http://mashe.hawksey.info
Pseudo-code     // onFormSubmit // get submitted data   // check if username has sheet   //    if not make   // copy submitted data to user's sheet  http://mashe.hawksey.info
Final code  function onFormSubmit() { // onFormSubmit // get submitted data var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Form_Sheet"); var headings = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues(); var lastRow = sheet.getRange(sheet.getLastRow(), 1, 1, sheet.getLastColumn()).getValues(); var studentUsername = lastRow[0][1]; // check if username has sheet if(ss.getSheetByName(studentUsername)){ var userSheet = ss.getSheetByName(studentUsername); //  if not make } else { var userSheet = ss.insertSheet(studentUsername); userSheet.getRange(1, 1 , 1, headings[0].length).setValues(headings); } // copy submitted data to user's sheet  userSheet.getRange(userSheet.getLastRow()+1, 1, 1, lastRow[0].length).setValues(lastRow); } http://mashe.hawksey.info

More Related Content

What's hot (20)

Power BI for CEO
Power BI for CEOPower BI for CEO
Power BI for CEO
Vishal Pawar
 
Power Automate
Power AutomatePower Automate
Power Automate
Fausto Capellan Jr
 
Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts
Folio3 Software
 
Scope proposal-ecommerce-website
Scope proposal-ecommerce-websiteScope proposal-ecommerce-website
Scope proposal-ecommerce-website
maxtra
 
Web Hosting, Web Design & Development Technical Proposal
Web Hosting, Web Design & Development Technical ProposalWeb Hosting, Web Design & Development Technical Proposal
Web Hosting, Web Design & Development Technical Proposal
Anthony Waweru
 
Getting the good oil on SOTL
Getting the good oil on SOTLGetting the good oil on SOTL
Getting the good oil on SOTL
Charles Darwin University
 
Netflix Infographic and Report (NETS2003/NETS5006)
Netflix Infographic and Report (NETS2003/NETS5006) Netflix Infographic and Report (NETS2003/NETS5006)
Netflix Infographic and Report (NETS2003/NETS5006)
Karen Wong
 
OTT marketing plan
OTT marketing planOTT marketing plan
OTT marketing plan
Anup Singh
 
On-line book store presentation
On-line book store presentation On-line book store presentation
On-line book store presentation
Smit Patel
 
ppt of web designing and development
ppt of web designing and developmentppt of web designing and development
ppt of web designing and development
47ishu
 
Web Design Proposal PowerPoint Presentation Slides
Web Design Proposal PowerPoint Presentation Slides Web Design Proposal PowerPoint Presentation Slides
Web Design Proposal PowerPoint Presentation Slides
SlideTeam
 
Netflix business model
Netflix business modelNetflix business model
Netflix business model
Jayesh Goswami
 
Website Development Process
Website Development ProcessWebsite Development Process
Website Development Process
Hend Al-Khalifa
 
Ecommerce website proposal
Ecommerce website proposalEcommerce website proposal
Ecommerce website proposal
Sudhir Raj
 
Export Data Lake Dynamics 365 F&O
Export Data Lake Dynamics 365 F&OExport Data Lake Dynamics 365 F&O
Export Data Lake Dynamics 365 F&O
Juan Fabian
 
What is Web 3.0?
What is Web 3.0?What is Web 3.0?
What is Web 3.0?
Johan Koren
 
The Website Redesign Process
The Website Redesign ProcessThe Website Redesign Process
The Website Redesign Process
Gary Schroeder
 
Report file on Web technology(html5 and css3)
Report file on Web technology(html5 and css3)Report file on Web technology(html5 and css3)
Report file on Web technology(html5 and css3)
PCG Solution
 
Power BI Reporting & Project Online
Power BI Reporting & Project OnlinePower BI Reporting & Project Online
Power BI Reporting & Project Online
Hari Thapliyal
 
AI-Powered Streaming Analytics for Real-Time Customer Experience
AI-Powered Streaming Analytics for Real-Time Customer ExperienceAI-Powered Streaming Analytics for Real-Time Customer Experience
AI-Powered Streaming Analytics for Real-Time Customer Experience
Databricks
 
Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts
Folio3 Software
 
Scope proposal-ecommerce-website
Scope proposal-ecommerce-websiteScope proposal-ecommerce-website
Scope proposal-ecommerce-website
maxtra
 
Web Hosting, Web Design & Development Technical Proposal
Web Hosting, Web Design & Development Technical ProposalWeb Hosting, Web Design & Development Technical Proposal
Web Hosting, Web Design & Development Technical Proposal
Anthony Waweru
 
Netflix Infographic and Report (NETS2003/NETS5006)
Netflix Infographic and Report (NETS2003/NETS5006) Netflix Infographic and Report (NETS2003/NETS5006)
Netflix Infographic and Report (NETS2003/NETS5006)
Karen Wong
 
OTT marketing plan
OTT marketing planOTT marketing plan
OTT marketing plan
Anup Singh
 
On-line book store presentation
On-line book store presentation On-line book store presentation
On-line book store presentation
Smit Patel
 
ppt of web designing and development
ppt of web designing and developmentppt of web designing and development
ppt of web designing and development
47ishu
 
Web Design Proposal PowerPoint Presentation Slides
Web Design Proposal PowerPoint Presentation Slides Web Design Proposal PowerPoint Presentation Slides
Web Design Proposal PowerPoint Presentation Slides
SlideTeam
 
Netflix business model
Netflix business modelNetflix business model
Netflix business model
Jayesh Goswami
 
Website Development Process
Website Development ProcessWebsite Development Process
Website Development Process
Hend Al-Khalifa
 
Ecommerce website proposal
Ecommerce website proposalEcommerce website proposal
Ecommerce website proposal
Sudhir Raj
 
Export Data Lake Dynamics 365 F&O
Export Data Lake Dynamics 365 F&OExport Data Lake Dynamics 365 F&O
Export Data Lake Dynamics 365 F&O
Juan Fabian
 
What is Web 3.0?
What is Web 3.0?What is Web 3.0?
What is Web 3.0?
Johan Koren
 
The Website Redesign Process
The Website Redesign ProcessThe Website Redesign Process
The Website Redesign Process
Gary Schroeder
 
Report file on Web technology(html5 and css3)
Report file on Web technology(html5 and css3)Report file on Web technology(html5 and css3)
Report file on Web technology(html5 and css3)
PCG Solution
 
Power BI Reporting & Project Online
Power BI Reporting & Project OnlinePower BI Reporting & Project Online
Power BI Reporting & Project Online
Hari Thapliyal
 
AI-Powered Streaming Analytics for Real-Time Customer Experience
AI-Powered Streaming Analytics for Real-Time Customer ExperienceAI-Powered Streaming Analytics for Real-Time Customer Experience
AI-Powered Streaming Analytics for Real-Time Customer Experience
Databricks
 

More from Martin Hawksey (20)

What about GDPR?
What about GDPR?What about GDPR?
What about GDPR?
Martin Hawksey
 
Twitter in Education: Interactively exploring the conversation with TAGS and ...
Twitter in Education: Interactively exploring the conversation with TAGS and ...Twitter in Education: Interactively exploring the conversation with TAGS and ...
Twitter in Education: Interactively exploring the conversation with TAGS and ...
Martin Hawksey
 
TEL Quality and Innovation: What can be learned from the history of computer ...
TEL Quality and Innovation: What can be learned from the history of computer ...TEL Quality and Innovation: What can be learned from the history of computer ...
TEL Quality and Innovation: What can be learned from the history of computer ...
Martin Hawksey
 
Making the complex less complicated: An introduction to social network analysis
Making the complex less complicated: An introduction to social network analysisMaking the complex less complicated: An introduction to social network analysis
Making the complex less complicated: An introduction to social network analysis
Martin Hawksey
 
Measuring Social Media Impact: Google Analytics and Twitter
Measuring Social Media Impact: Google Analytics and TwitterMeasuring Social Media Impact: Google Analytics and Twitter
Measuring Social Media Impact: Google Analytics and Twitter
Martin Hawksey
 
Google Apps Script the Authentic{ated} Mobile Playground
Google Apps Script the Authentic{ated} Mobile PlaygroundGoogle Apps Script the Authentic{ated} Mobile Playground
Google Apps Script the Authentic{ated} Mobile Playground
Martin Hawksey
 
Using CiviCRM in Google Drive with the new CiviService Google Script Library
Using CiviCRM in Google Drive with the new CiviService Google Script LibraryUsing CiviCRM in Google Drive with the new CiviService Google Script Library
Using CiviCRM in Google Drive with the new CiviService Google Script Library
Martin Hawksey
 
Google Analytics Workout (#IWMW16)
Google Analytics Workout (#IWMW16)Google Analytics Workout (#IWMW16)
Google Analytics Workout (#IWMW16)
Martin Hawksey
 
Extracting and analyzing discussion data with google sheets and google analytics
Extracting and analyzing discussion data with google sheets and google analyticsExtracting and analyzing discussion data with google sheets and google analytics
Extracting and analyzing discussion data with google sheets and google analytics
Martin Hawksey
 
Using WordPress as a badge platform #openbadgesHE
Using WordPress as a badge platform #openbadgesHEUsing WordPress as a badge platform #openbadgesHE
Using WordPress as a badge platform #openbadgesHE
Martin Hawksey
 
Looking at creativity and culture in computer science to inspire better educa...
Looking at creativity and culture in computer science to inspire better educa...Looking at creativity and culture in computer science to inspire better educa...
Looking at creativity and culture in computer science to inspire better educa...
Martin Hawksey
 
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Martin Hawksey
 
Creating personal tutoring environments with Google Apps Script
Creating personal tutoring environments with Google Apps ScriptCreating personal tutoring environments with Google Apps Script
Creating personal tutoring environments with Google Apps Script
Martin Hawksey
 
Learning analytics gaining good actionable insight
Learning analytics   gaining good actionable insightLearning analytics   gaining good actionable insight
Learning analytics gaining good actionable insight
Martin Hawksey
 
Custom reporting from CiviCRM with Google Sheets
Custom reporting from CiviCRM with Google SheetsCustom reporting from CiviCRM with Google Sheets
Custom reporting from CiviCRM with Google Sheets
Martin Hawksey
 
Learning analytics: Threats and opportunities
Learning analytics: Threats and opportunitiesLearning analytics: Threats and opportunities
Learning analytics: Threats and opportunities
Martin Hawksey
 
Google Apps Script: The Authentic{ated} Playground
Google Apps Script: The Authentic{ated} PlaygroundGoogle Apps Script: The Authentic{ated} Playground
Google Apps Script: The Authentic{ated} Playground
Martin Hawksey
 
Breaking the Cell #WebExpo
Breaking the Cell #WebExpo  Breaking the Cell #WebExpo
Breaking the Cell #WebExpo
Martin Hawksey
 
Open Badges in Open Education – Do They Count? #eas14
Open Badges in Open Education – Do They Count? #eas14Open Badges in Open Education – Do They Count? #eas14
Open Badges in Open Education – Do They Count? #eas14
Martin Hawksey
 
ocTEL and Open Badges #altc
ocTEL and Open Badges #altcocTEL and Open Badges #altc
ocTEL and Open Badges #altc
Martin Hawksey
 
Twitter in Education: Interactively exploring the conversation with TAGS and ...
Twitter in Education: Interactively exploring the conversation with TAGS and ...Twitter in Education: Interactively exploring the conversation with TAGS and ...
Twitter in Education: Interactively exploring the conversation with TAGS and ...
Martin Hawksey
 
TEL Quality and Innovation: What can be learned from the history of computer ...
TEL Quality and Innovation: What can be learned from the history of computer ...TEL Quality and Innovation: What can be learned from the history of computer ...
TEL Quality and Innovation: What can be learned from the history of computer ...
Martin Hawksey
 
Making the complex less complicated: An introduction to social network analysis
Making the complex less complicated: An introduction to social network analysisMaking the complex less complicated: An introduction to social network analysis
Making the complex less complicated: An introduction to social network analysis
Martin Hawksey
 
Measuring Social Media Impact: Google Analytics and Twitter
Measuring Social Media Impact: Google Analytics and TwitterMeasuring Social Media Impact: Google Analytics and Twitter
Measuring Social Media Impact: Google Analytics and Twitter
Martin Hawksey
 
Google Apps Script the Authentic{ated} Mobile Playground
Google Apps Script the Authentic{ated} Mobile PlaygroundGoogle Apps Script the Authentic{ated} Mobile Playground
Google Apps Script the Authentic{ated} Mobile Playground
Martin Hawksey
 
Using CiviCRM in Google Drive with the new CiviService Google Script Library
Using CiviCRM in Google Drive with the new CiviService Google Script LibraryUsing CiviCRM in Google Drive with the new CiviService Google Script Library
Using CiviCRM in Google Drive with the new CiviService Google Script Library
Martin Hawksey
 
Google Analytics Workout (#IWMW16)
Google Analytics Workout (#IWMW16)Google Analytics Workout (#IWMW16)
Google Analytics Workout (#IWMW16)
Martin Hawksey
 
Extracting and analyzing discussion data with google sheets and google analytics
Extracting and analyzing discussion data with google sheets and google analyticsExtracting and analyzing discussion data with google sheets and google analytics
Extracting and analyzing discussion data with google sheets and google analytics
Martin Hawksey
 
Using WordPress as a badge platform #openbadgesHE
Using WordPress as a badge platform #openbadgesHEUsing WordPress as a badge platform #openbadgesHE
Using WordPress as a badge platform #openbadgesHE
Martin Hawksey
 
Looking at creativity and culture in computer science to inspire better educa...
Looking at creativity and culture in computer science to inspire better educa...Looking at creativity and culture in computer science to inspire better educa...
Looking at creativity and culture in computer science to inspire better educa...
Martin Hawksey
 
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]Google Apps Script: The authentic{ated} playground [2015 Ed.]
Google Apps Script: The authentic{ated} playground [2015 Ed.]
Martin Hawksey
 
Creating personal tutoring environments with Google Apps Script
Creating personal tutoring environments with Google Apps ScriptCreating personal tutoring environments with Google Apps Script
Creating personal tutoring environments with Google Apps Script
Martin Hawksey
 
Learning analytics gaining good actionable insight
Learning analytics   gaining good actionable insightLearning analytics   gaining good actionable insight
Learning analytics gaining good actionable insight
Martin Hawksey
 
Custom reporting from CiviCRM with Google Sheets
Custom reporting from CiviCRM with Google SheetsCustom reporting from CiviCRM with Google Sheets
Custom reporting from CiviCRM with Google Sheets
Martin Hawksey
 
Learning analytics: Threats and opportunities
Learning analytics: Threats and opportunitiesLearning analytics: Threats and opportunities
Learning analytics: Threats and opportunities
Martin Hawksey
 
Google Apps Script: The Authentic{ated} Playground
Google Apps Script: The Authentic{ated} PlaygroundGoogle Apps Script: The Authentic{ated} Playground
Google Apps Script: The Authentic{ated} Playground
Martin Hawksey
 
Breaking the Cell #WebExpo
Breaking the Cell #WebExpo  Breaking the Cell #WebExpo
Breaking the Cell #WebExpo
Martin Hawksey
 
Open Badges in Open Education – Do They Count? #eas14
Open Badges in Open Education – Do They Count? #eas14Open Badges in Open Education – Do They Count? #eas14
Open Badges in Open Education – Do They Count? #eas14
Martin Hawksey
 
ocTEL and Open Badges #altc
ocTEL and Open Badges #altcocTEL and Open Badges #altc
ocTEL and Open Badges #altc
Martin Hawksey
 
Ad

Recently uploaded (20)

State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
Pharmaceutical_Incompatibilities.pptx
Pharmaceutical_Incompatibilities.pptxPharmaceutical_Incompatibilities.pptx
Pharmaceutical_Incompatibilities.pptx
Shantanu Ranjan
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in IndiaSmart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
fincrifcontent
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ FINALS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
Mani Sasidharan
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptxWRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
Sourav Kr Podder
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
Sritoma Majumder
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
State institute of educational technology
State institute of educational technologyState institute of educational technology
State institute of educational technology
vp5806484
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
 
Pharmaceutical_Incompatibilities.pptx
Pharmaceutical_Incompatibilities.pptxPharmaceutical_Incompatibilities.pptx
Pharmaceutical_Incompatibilities.pptx
Shantanu Ranjan
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptxPests of Rice: Damage, Identification, Life history, and Management.pptx
Pests of Rice: Damage, Identification, Life history, and Management.pptx
Arshad Shaikh
 
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in IndiaSmart Borrowing: Everything You Need to Know About Short Term Loans in India
Smart Borrowing: Everything You Need to Know About Short Term Loans in India
fincrifcontent
 
Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..Cloud Computing ..PPT ( Faizan ALTAF )..
Cloud Computing ..PPT ( Faizan ALTAF )..
faizanaltaf231
 
Freckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptxFreckle Project April 2025 Survey and report May 2025.pptx
Freckle Project April 2025 Survey and report May 2025.pptx
EveryLibrary
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
AR3201 WORLD ARCHITECTURE AND URBANISM EARLY CIVILISATIONS TO RENAISSANCE QUE...
Mani Sasidharan
 
Semisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptxSemisolid_Dosage_Forms.pptx
Semisolid_Dosage_Forms.pptx
Shantanu Ranjan
 
Dashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo SlidesDashboard Overview in Odoo 18 - Odoo Slides
Dashboard Overview in Odoo 18 - Odoo Slides
Celine George
 
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based EducatorDiana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda - A Wauconda-Based Educator
Diana Enriquez Wauconda
 
Adam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational PsychologyAdam Grant: Transforming Work Culture Through Organizational Psychology
Adam Grant: Transforming Work Culture Through Organizational Psychology
Prachi Shah
 
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptxWRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
WRITTEN THEME ROUND- OPEN GENERAL QUIZ.pptx
Sourav Kr Podder
 
POS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 SlidesPOS Reporting in Odoo 18 - Odoo 18 Slides
POS Reporting in Odoo 18 - Odoo 18 Slides
Celine George
 
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
CBSE - Grade 11 - Mathematics - Ch 2 - Relations And Functions - Notes (PDF F...
Sritoma Majumder
 
Optimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptxOptimization technique in pharmaceutical product development.pptx
Optimization technique in pharmaceutical product development.pptx
UrmiPrajapati3
 
Ad

Introduction to Google Apps Script

  • 1. Introduction to Google Apps Script On form submit filter data to sheets Martin Hawksey @mhawksey
  • 2. The Problem Hi there, I'm trying to get some student PT's to complete a training diary using a Google form. I would like the form to automatically create a new sheet for each user.  I should ultimately have 42 entries per user/sheet. http://www.google.com/support/forum/p/Google+Docs/thread?tid=6fe8356595e9b859&hl=en http://mashe.hawksey.info
  • 3. Solution 1 - Filter the data http://mashe.hawksey.info
  • 4. Solution 2 – Google Apps Script Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services. http://code.google.com/googleapps/appsscript/ http://mashe.hawksey.info
  • 5. How I see it http://mashe.hawksey.info
  • 6. How you write it In Spreadsheets Tools > Script Editor In Sites Manage Site > Apps Script http://mashe.hawksey.info
  • 7. How does the user interact with it In Spreadsheets In Sites As a service http://mashe.hawksey.info
  • 8. There’s good and bad news Bad news You need basic programming skills to write Good news Already a growing number of developers publishing scripts and tutorials for you to reuse e.g. http://www.flubaroo.com/ http://mashe.hawksey.info
  • 9. Lets do it https://spreadsheets.google.com/a/hawksey.info/spreadsheet/ccc?key=0Alq6_NgDnxLWdENvZHhwVm93TjRhTm5fcjU0X0t3Vnc Logins: [email_address] [email_address] … [email_address] Password: ******* http://mashe.hawksey.info
  • 10. Explanation of Javascript Objects got by getValues() data = [[“Dog”,”Cat”,”Cow”],[22, 31, 15],[6, 5, 5]] data[0] = [“Dog”,”Cat”,”Cow”] data[0][1] = “Cat” http://mashe.hawksey.info Dog Cat Cow 22 31 15 6 5 5
  • 11. Useful links Workshop material from Open4Ed http://mashe.hawksey.info/2011/05/app-app-and-away-workshop-handout-open4ed-gas/ Simple Apps Solutions (free Apps Script consultancy for Ed and tutorials) http://simpleappssolutions.com Official Apps Script Site Docs Tutorials Help forum http://mashe.hawksey.info
  • 12. Not forgetting your friendly EdTech explorer Email: [email protected] Blog: http://mashe.hawksey.info Tweet: @mhawksey http://mashe.hawksey.info
  • 13. Pseudo-code   // onFormSubmit // get submitted data   // check if username has sheet   //    if not make   // copy submitted data to user's sheet http://mashe.hawksey.info
  • 14. Final code function onFormSubmit() { // onFormSubmit // get submitted data var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName("Form_Sheet"); var headings = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues(); var lastRow = sheet.getRange(sheet.getLastRow(), 1, 1, sheet.getLastColumn()).getValues(); var studentUsername = lastRow[0][1]; // check if username has sheet if(ss.getSheetByName(studentUsername)){ var userSheet = ss.getSheetByName(studentUsername); // if not make } else { var userSheet = ss.insertSheet(studentUsername); userSheet.getRange(1, 1 , 1, headings[0].length).setValues(headings); } // copy submitted data to user's sheet userSheet.getRange(userSheet.getLastRow()+1, 1, 1, lastRow[0].length).setValues(lastRow); } http://mashe.hawksey.info