Now, when the user clicks on the "New Sheet" button the add-on generates a new spreadsheet formatted with a header row that is frozen such that it is always visible. NewSheetSection.addWidget(CardService.newButtonSet().addButton(newSheetButton)) Var newSheetButton = CardService.newTextButton() Var createExpensesSheet = CardService.newAction() Var sheetName = CardService.newTextInput() var newSheetSection = CardService.newCardSection() To get started, add the following card section to the card that createExpensesCard returns. For our add-on, let's allow the user to create a spreadsheet for expenses. Return createExpensesCard(null, e).build() īeyond using Google Apps Script to edit an existing spreadsheet, you can create an entirely new spreadsheet programmatically. Replace the contents of appsscript.json with these configuration settings: e An event object containing form inputs and parameters. In appscript.json, specify the metadata associated with the add-on, such as its name and the permissions it requires. To open the manifest file, at the left, click appscript.json.Select the Show "appscript.json" manifest file in editor" checkbox.Click Untitled project, name your project Expense It!, and click Rename.Leave Code.gs alone for now, you'll work with it later. The new project opens with a default file named Code.gs. To create a new project, at the top left, click New Project.From here, you can create, manage, and monitor your Apps Script projects. Start by writing the code for a simple version of the add-on that displays an expense form alongside an email.įirst, create a new Apps Script project and open its manifest file. To get the sample code, from the command line, run: git clone The GitHub repository contains sample code that you can use as a reference. Some messages, preferably email receipts, in GmailĪs you work through this codelab, it might be helpful to reference a working version of the code you'll write.Access to the internet and a web browser.Store user values using Google Apps Script's Properties service.Interact with Google Sheets via Google Apps Script.Create a Google Workspace Add-on for Gmail using Google Apps Script. The user can edit expense information and then submit it to log their expense into a Google Sheets spreadsheet. When a user receives a receipt by email, they open the add-on which automatically gets relevant expense information from the email. In this codelab, you'll use Google Apps Script to write a Google Workspace Add-on for Gmail that lets users add receipt data from an email to a spreadsheet directly within Gmail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |