\n","Gmail renders the markup above with a button labelled “Add to queue” next to the email subject line. When the user clicks on the button, Gmail sends a POST request to the url specified in the action handler. Your app has to handle these requests and respond to the email client with an appropriate HTTP response code (200 for successful requests, 400 for invalid requests, etc.).","Schemas in emails currently support four different types of actions - rate/review, RSVP, one-click action and goto link - and we plan to add more types moving forward. We are collaborating with a number of partners who will launch their integrations in the coming weeks, making the messages they send more useful and interactive for Gmail users. For example, Esna is using this to inform users of missed calls and provide them with a one-click button to be called again, while Seamless is implementing the rate/review action to collect feedback about restaurants.","Other partners who are already implementing schemas in email today include both Billguard, Concur Technologies, Docusign, HelloSign, Insight.ly, Mailchimp, myERP, Netflix, OpenTable, Orangescape, Paperless Post, Spotify, SugarCRM, and Tripit.","To learn more about all supported entities and actions and to find out how to get started with schemas in email, visit http://developers.google.com/gmail.","Claudio Cherubino","   "," | ","blog","Claudio is an engineer in the Google Drive Developer Relations team. Prior to Google, he worked as software developer, technology evangelist, community manager, consultant, technical translator and has contributed to many open-source projects. His current interests include Google APIs, new technologies and coffee.","\n\nLabels:\n\n\n\nGmail APIs\n\n\n","\nNew Apps Script features at Google I/O—again!\n","\nMay 14, 2013\n","today","\nScripts in Google Docs","extend Google Docs","on Thursday at 3:30pm PT","\nForms Service / Scripts in Google Forms","Forms Service","5-minute quickstart","on Wednesday at 1:55pm PT","\nDrive Service","Drive Service","on Thursday at 1:40pm PT","\nFaster HtmlService","HtmlService","enable an experimental version","\nImproved Authorization Flow and API Console Integration","opt in to an experimental new authorization flow","automatically creates a project in the Google APIs Console","File > Upgrade authorization experience","As you can see, we’ve been working hard to improve Apps Script for you. We hope you enjoy the new features!","Saurabh Gupta","\nAs the product manager for Google Apps Script, Saurabh is responsible for Apps Script’s overall vision and direction.","\n\nLabels:\n\n\n\nApps Script\n\n\n ,\n \n\nGoogle I/O\n\n\n","\nNew features for the Google Drive Realtime API\n","\nApril 30, 2013\n","We recently announced the launch of the Google Drive Realtime API that lets developers create collaborative apps with the same technology that powers Google Docs, Sheets, and Slides. Today we’ve added a couple of small, but very useful, features that let developers do even more with the Realtime API: undo and redo.","The new undo and redo features provide developers a way to easily undo (or redo) local changes without worrying about the complexities that can happen in a collaborative environment. The Realtime API automatically resolves potential conflicts from overlapping edits by collaborators to undo only the local changes.","The functions themselves are very simple to implement. The following code demonstrates how straightforward adding this functionality to your app can be:","if (model.canUndo) {\n model.undo();\n}","You could connect this code directly to an undo button in your app’s UI to undo the last change a local user made. No extra hard work required!","Undo and redo also come with an associated event emitted by the model class that lets you know when the features are available. You just need to attach an event listener to the model and wire up the appropriate UI changes to enable/disable undo/redo buttons. For example, you could add two buttons inside the ",""," tag of your HTML document:","\n","Then, add the following code inside the onFileLoaded callback inside your script to connect the logic to the buttons:","var model = doc.getModel();\nvar undoButton = document.getElementById('undoButton');\nvar redoButton = document.getElementById('redoButton');\n\nundoButton.onclick = function(e) {\n model.undo();\n};\nredoButton.onclick = function(e) {\n model.redo();\n};","Then add an event handler to enable and disable the buttons when local changes are available:","var onUndoRedoStateChanged = function(e) {\n undoButton.disabled = !e.canUndo;\n redoButton.disabled = !e.canRedo;\n};\nmodel.addEventListener(gapi.drive.realtime.EventType.UNDO_REDO_STATE_CHANGED, onUndoRedoStateChanged);","For a complete example of this implementation, see the Realtime Quickstart.","The Realtime API makes implementing undo/redo features very straightforward for most applications. For more information, see the Realtime API documentation.","Greg Knoke","\nGreg Knoke is a technical writer in the Google Drive Developer Relations Team. Prior to joining Google, he worked as a scientist developing image and signal processing algorithms. His current interests include new technologies, content management, information architecture, cooking, music, and photography.","\nHow Apps Script Makes Classroom Observation Quicker and Easier\n","\nApril 29, 2013\n","Editor’s Note: Guest author Martin Hawksey is an advisor at the Jisc Centre for Educational Technology and Interoperability Standards. — Dan Lazin","When I started looking at Google Apps Script in 2010, one of the things that attracted me was the ease with which a non-developer like me could start customising Google Apps with only a few lines of code. Since then, the rich community of users and examples has continued to grow, and I’ve built event booking systems, entire student feedback solutions, and even integrated with Mozilla Open Badges.","Recently, Justin Marckel, the assistant principal at Cornatzer Elementary School in North Carolina, asked for help in modifying one of my existing Apps Script examples. Justin was recording teachers’ classroom activities using a Google Form, then manually copying and pasting data into separate spreadsheets for each teacher to review. Justin wanted to know whether there was a way for a Google Form to store the results in a master spreadsheet, then filter results to each teacher’s spreadsheet.","The basic pseudocode would be:","on form submit\n if teacher’s spreadsheet doesn’t exist, then\n create spreadsheet\n add teacher as viewer\n store id\n else\n get id\n open teacher’s spreadsheet\n copy values to teacher’s spreadsheet","Here’s a closer look at each of the steps.","Handling a form submission event","Apps Script offers three triggers specific to Google Sheets: “on open,” “on edit,” and “on form submit.” Looking at the Understanding Events documentation, we can see that a form submit trigger gives us a few options for how to pull the submitted values out of the event parameter (usually called e). We can get the data as an array via e.values, a Range object via e.range, or a JavaScript object that pairs the form questions with the respondent’s answers via e.namedValues. In this project, the e.values array is most convenient, and it will look something like this:","['2010/03/12 15:00', 'bob@example.com', 'Bob', '27', 'Susan', '25']","First, though, we have to add the form-submission trigger. The user could add it manually from the script editor’s Resources menu, but in this case, let’s manage triggers programmatically:","function setup(){\n if (ScriptApp.getScriptTriggers().length === 0) {\n ScriptApp.newTrigger('doOnFormSumbit')\n .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())\n .onFormSubmit()\n .create();\n }\n}","Creating and managing permissions on a spreadsheet","One of the big advantages Apps Script is that you’re automatically working in a Google-authenticated environment. The result is that you can programmatically create a new spreadsheet with one line of code, then add a teacher as a viewer in just one more line:","var newSS = SpreadsheetApp.create('Spreadsheet Name');\nnewSS.addViewer('email-address-of-teacher');","Writing data to a spreadsheet","Writing data to a sheet requires more than a one-liner just because we need to specify which cells to write to. The ","Range.setValues()"," method expects a 2D array; because we’ve already retrieved the response to the form as an array, it’s easy to throw those values into a row of cells:","var destSS = SpreadsheetApp.openById(id); // open teacher spreadsheet\nvar destSheet = destSS.getSheets()[0]; // grab first sheet\nvar insertRow = destSheet.getLastRow() + 1; // next row to enter data\ndestSheet.getRange(insertRow, 1, 1, e.values.length)\n .setValues([e.values]);","Simple, effective and efficient","The completed project is here. The bulk of the form-submission handling (including error logging) happens in around 50 lines of code, and I was able to complete the project within an hour. Now Justin no longer needs to copy, paste, and set up separate spreadsheets, potentially saving him hours of work. Justin recently contacted me to say:","“We have successfully used our program over the past couple of months to provide teachers with meaningful and efficient feedback. It has been successful at several other schools as well, and I got word today that our school district is looking at adopting it as a district-wide tool.”","This is just one of a growing number of examples of how Google Apps Script is directly benefitting educators by allowing custom solutions with the security, convenience, and power of Google Apps.","Martin Hawksey","
Martin is an advisor at the Jisc Centre for Educational Technology and Interoperability Standards (CETIS), a national advisory and innovation centre that works on on educational technology and standards for the UK Higher Education and Post-16 Education sectors. Martin is an active contributor to the Apps Script community and regularly shares projects on his blog, MASHe.","\n\nLabels:\n\n\n\nApps Script\n\n\n ,\n \n\nGuest Post\n\n\n","\nMore ways for apps to write to Drive\n","\nApril 4, 2013\n","Today we’re introducing two new ways for apps to build even richer integrations with Drive: app data folders and custom properties.","In order to run smoothly, your app may depend on data it stores in Drive. But occasionally, users may accidentally move or delete the very file or folder your app needs to function. The app data folder is a special folder in Drive that can only be accessed by your app. The app folder’s content is hidden from the user and from other apps, making it ideal for storing configuration files, app state data, or any other files that the user should not modify.","Although users cannot see individual files in the app data folder, they are able to see how much app data your app is using and clear that data in the Manage Apps dialog.","Apps can also now add custom properties to any Drive file. The new properties collection gives your app the power to create searchable fields that are private to your app or shared across apps. For example, a classroom app could keep track of the grade for a document or a project management app could keep track of the current status of a document going through a review process.","To learn more check out the technical documentation for both app data folders and custom properties, and if you have questions don’t hesitate to post on StackOverflow.","Nicolas Garnier","Twitter","\n
\nNicolas Garnier joined Google’s Developer Relations in 2008 and lives in Zurich. He is a Developer Advocate for Google Drive and Google Apps. Nicolas is also the lead engineer for the OAuth 2.0 Playground.","\n\n\n \n \n\n\n\n\n \n \n\n\n\n\n\n \n \n\n\n","\nLabels\n","\n \n ","\n\n.NET\n\n\n3\n\n","\n\n#io15\n\n\n1\n\n","\n\n#io16\n\n\n1\n\n","\n\nAdmin SDK\n\n\n10\n\n","\n\nAdministrative APIs\n\n\n31\n\n","\n\nAdSense\n\n\n1\n\n","\n\nanalytics\n\n\n5\n\n","\n\nAndroid\n\n\n8\n\n","\n\nAPI\n\n\n3\n\n","\n\nAPIs\n\n\n3\n\n","\n\nApp Engine\n\n\n5\n\n","\n\nApps\n\n\n1\n\n","\n\nApps Script\n\n\n118\n\n","\n\nAudit\n\n\n2\n\n","\n\nAuth\n\n\n5\n\n","\n\nbilling\n\n\n4\n\n","\n\nCharts\n\n\n2\n\n","\n\nChrome OS\n\n\n1\n\n","\n\nclassroom\n\n\n3\n\n","\n\nCloud Storage API\n\n\n1\n\n","\n\nCommunity\n\n\n1\n\n","\n\ndecks\n\n\n1\n\n","\n\nDesign\n\n\n1\n\n","\n\nDevelopers\n\n\n12\n\n","\n\nDirectory API\n\n\n3\n\n","\n\nDrive\n\n\n4\n\n","\n\nDrive SDK\n\n\n41\n\n","\n\nexecution API\n\n\n2\n\n","\n\nFirebase\n\n\n1\n\n","\n\nForms\n\n\n1\n\n","\n\nFreemium\n\n\n1\n\n","\n\nFusion Tables\n\n\n2\n\n","\n\nG Suite\n\n\n24\n\n","\n\nGadgets\n\n\n5\n\n","\n\nGmail\n\n\n7\n\n","\n\nGmail APIs\n\n\n23\n\n","\n\nGoogle\n\n\n3\n\n","\n\nGoogle APIs\n\n\n36\n\n","\n\nGoogle Apps\n\n\n33\n\n","\n\nGoogle Apps Marketplace\n\n\n7\n\n","\n\nGoogle Calendar API\n\n\n25\n\n","\n\nGoogle Classroom\n\n\n4\n\n","\n\nGoogle Cloud Directory\n\n\n1\n\n","\n\nGoogle Contacts API\n\n\n4\n\n","\n\nGoogle Data Protocol\n\n\n8\n\n","\n\ngoogle docs\n\n\n5\n\n","\n\nGoogle Docs API\n\n\n22\n\n","\n\nGoogle Drive\n\n\n8\n\n","\n\nGoogle Drive SDK\n\n\n7\n\n","\n\nGoogle Forms\n\n\n8\n\n","\n\nGoogle I/O\n\n\n3\n\n","\n\nGoogle Prediction API\n\n\n3\n\n","\n\nGoogle Profiles API\n\n\n2\n\n","\n\nGoogle sheets\n\n\n11\n\n","\n\nGoogle Sheets API\n\n\n7\n\n","\n\nGoogle Sites API\n\n\n5\n\n","\n\nGoogle Slides API\n\n\n10\n\n","\n\nGoogle Spreadsheets API\n\n\n5\n\n","\n\nGoogle Talk\n\n\n1\n\n","\n\nGoogle Tasks API\n\n\n8\n\n","\n\nGoogle+\n\n\n3\n\n","\n\ngooglenew\n\n\n1\n\n","\n\nGroups\n\n\n2\n\n","\n\nGSuite\n\n\n3\n\n","\n\nGuest Post\n\n\n43\n\n","\n\nHangouts Chat API\n\n\n1\n\n","\n\nI\n\n\n1\n\n","\n\nInbox\n\n\n1\n\n","\n\niOS\n\n\n2\n\n","\n\nissue tracker\n\n\n1\n\n","\n\nISVs\n\n\n2\n\n","\n\njava\n\n\n1\n\n","\n\nJavaScript\n\n\n6\n\n","\n\nmarketing\n\n\n3\n\n","\n\nMarketplace\n\n\n47\n\n","\n\nMarketplace ISV Guest\n\n\n21\n\n","\n\nMigration\n\n\n2\n\n","\n\nMobile\n\n\n5\n\n","\n\nmpstaffpick\n\n\n1\n\n","\n\noauth\n\n\n16\n\n","\n\nOpenID\n\n\n8\n\n","\n\nPHP\n\n\n1\n\n","\n\npresentations\n\n\n1\n\n","\n\npython\n\n\n7\n\n","\n\nrealtime API\n\n\n2\n\n","\n\nResellers\n\n\n2\n\n","\n\nRuby\n\n\n1\n\n","\n\nSaaS\n\n\n1\n\n","\n\nsecurity\n\n\n5\n\n","\n\nSheets API\n\n\n3\n\n","\n\nspreadsheets\n\n\n3\n\n","\n\nStaff Picks\n\n\n2\n\n","\n\ntool\n\n\n1\n\n","\n\ntools\n\n\n2\n\n","\n\ntutorials\n\n\n2\n\n","\n\nvideo\n\n\n4\n\n","\n\nvideos\n\n\n1\n\n","\n\nwebinar\n\n\n2\n\n","\n \n ","\nArchive\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2018\n\n","\nJul\n","\nJun\n","\nMay\n","\nMar\n","\nFeb\n","\nJan\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2017\n\n","\nDec\n","\nNov\n","\nOct\n","\nSep\n","\nAug\n","\nApr\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2016\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2015\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2014\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2013\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2012\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2011\n\n","\n\n\n \n \n\n\n\n\n \n \n  \n \n\n\n\n2010\n\n","Feed","Google","on","Follow @gsuitedevs","\nCompany-wide\n","Official Google Blog","Public Policy Blog","Student Blog","\nProducts\n","Android Blog","Chrome Blog","Lat Long Blog","\nDevelopers\n","Developers Blog","Ads Developer Blog","Android Developers Blog","\n Google\n ","\n Privacy\n ","\n Terms\n "]}