Taking Advantage of Google Apps Script | Kanshi Tanaike | Skillshare

Taking Advantage of Google Apps Script

Kanshi Tanaike

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
17 Lessons (1h 4m)
    • 1. Introduction

      5:18
    • 2. Basic Level : Google Apps Script

      2:32
    • 3. Basic Level : Script Editor

      3:12
    • 4. Basic Level : Authorization and Libraries

      2:28
    • 5. Basic Level : Use API

      1:54
    • 6. Basic Level : Manifests and Debug

      2:43
    • 7. Intermediate Level 1: How to Use Google Docs

      5:12
    • 8. Intermediate Level 1: Put values to Google Docs

      2:25
    • 9. Intermediate Level 1: Sample situations of Spreadsheet

      5:02
    • 10. Intermediate Level 1: Sample situations of Document and Slides

      6:08
    • 11. Intermediate Level 1: Process Costs

      3:29
    • 12. Intermediate Level 2: How to use files in Google Drive

      3:53
    • 13. Intermediate Level 2: Move folder and Search files

      3:04
    • 14. Intermediate Level 3: How to use Web Apps

      6:00
    • 15. Advanced Level: File uploader to Google Drive

      3:51
    • 16. Advanced Level: File downloader from Google Drive

      3:04
    • 17. Advanced Level: Original APIs

      4:11

About This Class

  • What the class is about and a few of the skills students will learn
    - Users can learn about how to use Google Apps Script as follows.
    - Basic level: How to use script editor for using Google Apps Script, use libraries, APIs and Manifests.
    - Intermediate level 1: How to use Google Docs (Spreadsheet, Document and Slides) using Google Apps Script.
    - Intermediate level 2: How to use files in Google Drive using Google Apps Script.
    - Intermediate level 3: How to use Web Apps using Google Apps Script.
    - Advanced level: Create actual applications.
  • What students will create in their class project
    - Management of Google Docs using dialog and template file.
    - Library.
    - Add-on.
    - File uploader to Google Drive.
    - File downloader from Google Drive.
    - Original APIs.
    I will teach some of them.
  • Who the class is geared toward or if any prior knowledge or experience is required
    - In this class, any prior knowledge or experience is not required, because users can learn the basic usage at Basic level and Intermediate level. And also users can learn how to create some actual applications at Advanced level.

About the scripts used in this presentation, you can download the scripts from my Gists.

2259d43a

Transcripts

1. Introduction: Hello, My name is Tannic. Recently I was invited here from the staff of skills hair dot com here I would like to teach about taking advantage of Google App Scripture. For this, I would like to tell you from the basic usage to the advanced usage which used the actual applications. Also, I would like to study myself by teaching you. By the way, I cannot speak English well, So I would like to use TVs of the voice RSS. In this class, users can learn about how to use Google AB script as follows. The aim of this class is that users get to be able to create own applications using Google App Scripture. I hope that this class would like to make users have the chance to achieve it here in the basic level. How to use script editor for using Google APP script use libraries AP eyes and manifests. By knowing them, it learns the basic information of Google AB Scripture. In the intermediate level, there are three parts. The 1st 1 is that how to use Google Docks, spreadsheet document and slides using Google app Scripture. The 2nd 1 is that how to use files in Google Drive using Google App Scripture as the last one. It's how to use Web APS using Google App Scripture. I think that when these lessons are finished, users can obtain the knowledge to create own applications using Google App Scripture. So I ads the advanced level here. Let's create actual applications about thes contents as samples. I would like to use the methods which are often used in this class as the sample applications users create some of these themes. I would like to decide the applications which are created while it progresses. The lesson in the case of management of Google docks using dialogue and template file, for example, input the values at a dialog box and put the values to the spreadsheet and copy the template values of spreadsheet to a worksheet. Such functions are also used for the actual situation. In the case of library and add on users. Create a sample library and add on and use it when the library can be used. It will lead to the improvement of the development cost about file upload ER and slash, or downloader. As an application, users create the up loader and slash, or downloader from the local PC to Google drive. These are also the practical applications about original AP eyes. Users can learn also about Web APS By learning this about the themes which were not selected from the following themes. I will do them at the next class as the last section of introduction I would like to introduce about me. I started joining skills hair dot com when I got an email of the invitation from the stuff . The email said that it saw my answers at Stack overflow. If my experiences are useful for a lot of people, I'm so glad also, answering to the questions makes me grow myself. So I had joined Stack Overflow. When I read the invitation email and the concept of skills hair dot com, I felt that this is the same direction with me. So I decided to join skills hair dot com here. I would like to teach about taking advantage of Google App script, and also I would like to study a lot of things by teaching if this class was useful for you . I'm glad. Thank you. Then I really appreciate for Nina and commission who invited me and give me a great chance to study myself 2. Basic Level : Google Apps Script: here as basic level. I would like to tell you about how to use script editor for using Google APP script, use libraries, AP eyes and manifests. The document of Overview of Google AB script says that Google AB script is a scripting language based on JavaScript that lets you do new and cool things with G sweet products like docks, sheets, slides and forms. There's nothing to install. We give you a code editor right in your browser and your scripts run on Google servers as an important point at basic JavaScript features. Google says that Google AB script is based on JavaScript 1.6 plus a few features from 1.7 and 1.8. For example, The arrow functions cannot be used at Google App Scripture. I think that this will update in the future, but in the current stage, users have to follow. This script editor can be used for creating and running Google App Scripture here. I would like to tell you about launch script editor. There are two types of Google AB scripture. Those are container bound, script type and stand Alan script type. The container bound script type binds to Google docks. So, for example, you can create new project and launch the script editor from spreadsheet, as shown in the Left image for other Google docks. You can also launch the script editor from tools of the Menu Bar. The Stand Alan script type is not bound to Google docks. It's independent project. You can create new Stand Alan Project by the right click as shown in the right image. If you cannot find Google AB script there, please click. Connect more APS and search Google App script, and then please install Google App Scripture. 3. Basic Level : Script Editor: this image is the script editor for creating and running Google App Scripture. When the script editor is opened, you can see this screen at your browser. There are some applications for creating and running Google App Scripture. I also created such application, but here I would like to introduce the script editor of Google as the default. You can see a function with the function name of my function, and my function is selected at select function. In this case, when the run button is clicked, it means that my function is run in this class. For example, when I say that a function of sample is run, please sample at select function and click run button. In the most cases, users run Google AB script using the script editor. There are several methods without using script editor for running Google App Scripture here I would like to introduce about them. Google App script can be run by some events. Those are that it uses custom functions. Google docks were opened and edited for this event. There are simple triggers and install a ble triggers and use the time driven trigger and get and post methods were called for Web ABS and the functions were called by a P I about thes methods I would like to introduce using the actual situations while it proceeds with lesson. When users use Google maps cribbed, there are quotas. The most important value is the script runtime. In the current stage, maximum runtime is six minutes. For most users at G suite business, 30 minutes can be used for one execution. Furthermore, Google AB scripts still cannot use the V eight engine about this. I have heard that the V eight engine is implemented in the future. Because of this quota, most users always have to pay attention to reducing the process cost of the scripts in this class. I would like to also mention about this. I would like to introduce how to write the high efficiency scripts and about benchmarks to write. The high efficiency scripts also leads to the reduction of cost for Google. I think that this is very important for users and Google Server 4. Basic Level : Authorization and Libraries: when it runs the script at script editor, you will see the authorization screen as shown an image one. This means Theo Authorization of scopes, which are used in the script. By authorizing this, you can run the script and retrieve the results When you see the screen like image one, please click. Review permissions and choose account and click Advanced and click. Go to project name like image to By this flow, you can see the scopes in this sample image. 34 scopes are used, so authorize them. Please click Allow. By this. The use of scopes in this script are permitted. This process is required to do only when new scopes are used in the script. After the scopes are authorized. Once you are not required to do this process again here, I would like to tell you about library. Google AB script can use libraries by libraries of Resource is from Menu Bar at the script editor. When it is opened like this, you can see the screen as shown in the image. You can use the personal libraries that you created and also used the public libraries which were created by other developers. Unfortunately, the libraries cannot be searched from script editor. If you want to search the library's, please check it Hub and each developers page in this image as a test. The library of I M GF is installed. When you install the library. Please put the project key to the text box of Add a library and click add button and select version and click save button. By this, you can use libraries. Libraries will be able to largely reduce the development cost. 5. Basic Level : Use API: Google provides various AP eyes. Such a P eyes can be also used by Google App scripture. There are cases that AP eyes reduce the process cost comparing to the building methods. And also there are some methods of only AP eyes. So I think that to use a P eyes is very important for the development. There are two patterns for using a P eyes. One is to use advanced Google services. Another is to fetch the endpoint of AP eyes here. I would like to introduce about the method using advanced Google Services. You can open the screen of advanced Google Services by advanced Google Services of Resource is from Menu Bar at the script editor. This image is it in this image as a test, it is found that she eats a P. I is enabled in order to use sheets. AP I. After she eats a P, I is enabled at advanced Google services. It is required to enable sheets. AP I at a P I console after she eats a P. I is enabled at advanced Google services. When she eats a P I at a P I console is not enabled. The following error occurs at that time. Please open the u. R L and enable a p i by clicking enable button by this sheets AP I can be used at Google App Scripture. 6. Basic Level : Manifests and Debug: by the recent update Manifests is added to Google App Scripture. The document of Manifest says that an AB script Project Manifest is a special J. S. O. N file that specifies a basic project. Information that AB script needs to run the script successfully. You can see the current manifests by selecting show Project Manifest of You from Menu Bar at the script editor. This is an image of the current manifests file. At this introduction, a library was installed and sheets AP. I was enabled at advanced Google Services. You can see that these are reflected to manifests by using manifests. These installation can be managed and also scopes can be managed. This manifests is also very important for the development. By the way, I have created a library for managing manifests when you create the applications using Google APP script. If the error occurs, it is required to do the debug here. I would like to introduce how to check the logs when the script is run. At Google AB script, several methods for logging are prepared. The method, which is most used, is logger log and recently console log was added. The log of lager log is overridden. Every run but console log can see the old logs. At the execution transcript. You can see the record of each call to a Google AB script service. For example. This can be used when it confirms the condition of the script run by on open of event. If the permission error had occurred, you can know it by this. You can see the sample script and results for logger log console log and execution transcript here. Although also you can debug using break points about this, please check the web page. This is the references which were used at this presentation. 7. Intermediate Level 1: How to Use Google Docs: here as intermediate level. I would like to talk about three contents. The 1st 1 is how to use Google Docks, spreadsheet document and slides using Google App Scripture. The 2nd 1 is how to use files in Google Drive using Google App Scripture. The last one is how to use Web APS using Google App Scripture at the intermediate level one . I would like to talk about how to use Google docks using Google App Scripture here. I would like to talk about how to use Google docks using Google App Scripture. Google docks are spreadsheet, document and slides in this section. Using sample script, you can learn about how to open Google docks, how to get values from Google docks and how to put values to Google docks about them. From my experience, I would like to introduce the methods, which are often used. At first, I would like to talk about how to open Google docks before it uses the sample scripts. I would like to tell about the manual document for using Google Docks. If you want to know about some methods you want to use Google docks, please read these documents. These documents are often updated and new methods are sometimes added. So I think that to check the documents also leads to new information. In order to use Google docks at first, open the Google docks and retrieve the object of the Google docks using the object, users can get and put values for the Google docks. Although there are several ways for this situation here, I would like to introduce to patterns, which are often used. One is that it opens from the container bound script. This is used for a lot of cases. Another is that it opens Google docks using file i D I. D. Means the file I D of Google Docks this way is used for opening Google docks from the stand Alan script, an opening other Google docks from the container bound script. Next, I would like to talk about get values from Google docks. In the most cases, it retrieves the values from Google docks. So this is the basic method for Google docks here. I would like to talk about how to get values from Google docks. The variables of spreadsheet, document and slides were used at the section of open Google docks. In the case of spreadsheet. The sample script retrieves values from a one cell of S H E E T one and a one C three cells of S H E E T. One, respectively. Most users use get value and get values for retrieving values from cells. Value is string and number values is two dimensional array. Please be careful this and as one more important point when it uses get value. The process cost of get value is much higher than that of get values. So I would like to recommend to use get values if you want to retrieve values from several cells. At first, it retrieves the values from several cells using get values, and then it processes the values as theory A. By this, the process cost can be reduced. In the case of document, it retrieves the text from the body. Of course, the texts can be also retrieved from paragraph, table and objects put in the body. At that time, it put the methods between get body and get text. In the case of slides, the sample script retrieves the text strings from the first shape at the first page. In this case, the text strings can be retrieved from various objects in slides like the case of document 8. Intermediate Level 1: Put values to Google Docs: here. I would like to talk about put values to Google docks. Also, to put values to Google Docks is one of important methods. By knowing how to get and put values, this can be applied to create applications. Next, I would like to talk about how to put values to Google docks. The variables of spreadsheet, document and slides were used at the section of open Google Docks. In the case of spreadsheet, the top sample script puts a one to sell a one. The bottom script puts nine values to a one to C three. The values which are used for set value and set values are string and two dimensional array , respectively. Also, please be careful this and about this situation. Most users use set value and set values for putting values as same as get values as one more important point when it uses set value. The process cost of set value is much higher than that of set values, so I would like to recommend to use that values if you want to put values to several cells . When you use that values, please create an array and used the array to set values in the case of document. The top and bottom scripts put the text to the body at the text to the body respectively, said Text is replaced. The existing text in the body upend paragraph adds the text to the body. Of course, the texts can be also put to table and objects. In the case of slides, the sample script puts the text to the first shape at the first page. In this case, the text strings can be also put to various objects in slides like the case of document. 9. Intermediate Level 1: Sample situations of Spreadsheet: here. I would like to introduce three sample situation using spreadsheet, document and slides about the situation of spreadsheet. When a check box is checked, it copies the row with check check box to other spreadsheet about the situation of document . It copies a template document and replace the values in the template document by other values and convert to PdF and send it file as an email about the situation of slides. It creates a table of spreadsheet to slides these situations are actually using. So I thought that these situations become good samples. I would like to introduce a sample situation that I often see at spreadsheet. The situation is when a check box is checked, it copies the row with check check box to other spreadsheet. Let's create a sample script in order to create this application, please prepare as follows at first, create new spreadsheet, an open script editor and said the project name. This is a source sheet. Please set the values as follows. Then create new spreadsheet. This is a destination sheet, and please copy the spreadsheet. I d. You can find the spreadsheet I D from the u R L. Please copy Paste this script to the script editor of the created Stand Alan Project and please replace the spreadsheet I D. For yours. Let's think of the flow of this script at first Open spreadsheet and retrieve values and retrieve Rose. That check box was checked. If there is no rose with the check check box, the script is finished. If there are the Rose opened the destination spreadsheet and put the rose to the sheet here . I used for loop to this script, but this for loop can be replaced to the filter function like this, and the process cost of the filter function is much lower than that of four Loop, so I recommend to use the filter function for this situation as another situation. I would like to introduce about the situation that the row is copied as the trigger that users checked the check box. The sample script is this. In this script on edit function is used as Theo event. Trigger on edit can be run the script. When the cells are edited in the spreadsheet and in the event trigger, the event object can be used. Please see this script he dot range an e dot source are used. The event object is used here he dot range an e dot source mean that the edited range and the edited sheet respectively. In this case, the process cost is lower than spreadsheet class. Before you use this script, there is one more preparation. It is to install the trigger to Annette it in this script in order to open the destination spreadsheet, a method of open by I D is used in order to use such methods which are required to authorise it is required to install the trigger. So please install the trigger as this flow By this when users checked the check box, the row is confident immediately if the trigger is not installed Even when users checked the check box, the row is not cop ID. So it seems that the script doesn't work at that time. Please open the execution transcript at script editor. You will be able to see the error of you do not have permission to call open by i d of spreadsheet app 10. Intermediate Level 1: Sample situations of Document and Slides: I would like to introduce a sample situation that I often see a document. The situation is that it copies a template document and replace the values in the template document by other values and convert to pdf and send it file as an email as the preparation . Please create new document and new project. The project is the stand Dell on type. Then for the created new document, please put thes text in this sample situation. Replace one replaced two and replace three are replaced and converted to pdf and send it as email. Please copy Paste this script to the script editor of the created Stand Alan Project, and please replace the document I d for yours. When this script is run, copy the template document and replace the text. Then the copied document is sent by email as pdf file. Let's think of flow of this script in this script. At first, copy the template document and retrieve the carpet document I D. After copied, the document is opened and replace the text. Then the edited document is saved by save and close method. This is very important If this function is not used. The document without The replacement of text is converted to pdf file. I have heard a lot of issues related to this situation, so please remember this after the document was saved. The document is converted to PdF in this script in order to convert if uses get blob at Google docks. When the blob is retrieved from Doc's, the mime type is automatically changed to pdf. This is used for this situation. The document, converted to PDF, is sent as an email using male up. I would like to introduce a sample situation that I often see at slides. The situation is that it creates a table of spreadsheet to slides as the preparation. Please create new slides, an open script editor and set file name of Project and create new spreadsheet and put the values like this. In this sample, these values are created two slides as a table. Also, you can freely give the colors bold and so on for each cell. In this situation, the sample script is constructed with three functions. One is a function for retrieving the values and for mets from spreadsheet, open spreadsheet and retrieve the values and formats. Then it returns them important point is to use the method of get display values for retrieving values. This method can retrieve the display value. So when the table of spreadsheet is put to slides as a table, I think that this is suitable then, as the formats, the alignment, background and found colors and fund wait are retrieved. Please copy paste this script to the script editor of the created container bound script. This is the second function this is for used to convert the alignment data for slides from the alignment data of spreadsheet. Because the format data of spreadsheet and slides is different. Please, at this script to the script editor, which is putting the first function next, I would like to talk about last function. This is the main function for this sample situation. Please add this script to the script editor. Let's think of the flow of this script At first. The function of get values from spreadsheet is run and retrieved. The values and format data from spreadsheet, then open slides an insert new table after a new table was inserted. The values and formats are given to the table because the format data of spreadsheet and slides is different. it is required to convert for using the data at slides, values, horizontal alignments, backgrounds, fund colors and fund weights are two dimensional array, respectively, and the coordinates of each array is the same for all a raise, so the same for loop can be used. When my function is run, new table is created in the first page of slides like this, you can see that the values and formats are copied. 11. Intermediate Level 1: Process Costs: here. I would like to talk about the process. Costs of Google AB Scripture There are a limit executing time for Google app Scripture. For most users, that is six minutes. By this limitation, users always have to pay attention to reducing the process cost of the scripts. I think that thes process costs will be updated in the future update, but I think that it is very important to know the current process cost for various methods and the process cost of Google AB script is different from other language, so I continue to measure the process costs for various methods and publish them in this section. I would like to introduce the part of them here. There are two images. These images were taken for knowing the process cost of retrieve values from spreadsheet and put values to spread sheet for retrieving values. The process cost of get value and get values were measured for putting values. Set value and set values were measured from the result of retrieving values. It is found that the process cost of get values is much lower than that of get value when the number of roses increased also from the result of putting values. It is found that the process cost of set values is much lower than that of set value. When the script is created by considering various process costs, it can reduce the cost of whole script. This is the result which measured the process cost of loop for array processing. Using Google app scripture at the section of the sample situation of spreadsheet. I told you that the process cost of the filter function is much lower than that of four loop. This result is the basis in this case, the process cost is the process time. When the number of elements of array is increased, the process cost is also increased. But the trend of the increase is different between the methods. When it sees this image, the process cost of map filter function is much lower than that of others. When I create the applications using Google APP script, I create them by taking into account such results. This result is different from other languages. So when I created the applications using other languages, I create them by taking into account each process cost. This is the references which were used at this presentation 12. Intermediate Level 2: How to use files in Google Drive: at the intermediate level two. I would like to talk about how to use files in Google Drive using Google App Scripture here . I would like to talk about how to use files in Google Drive using Google App Scripture in order to use files in Google Drive drive A p I can be used. But here I would like to talk about the methods using class drive app because this is often used by a lot of users. At first, I would like to introduce about open create an update files before it uses the sample scripts. I would like to tell about the manual document for using Google Drive for Google App Scripture. If you want to know about some methods you want to use, please read this documents. This document is often updated and new methods is sometimes added. So I think that to check the documents also leads to new information. In order to use Google, drive at first as a sample, open a text file and retrieve the content, these scripts can be used for the project of both the stand Alan type and the container bound script type. Here, a text file is used as a sample at first opened the text file in Google Drive. In this sample, the file with the file Name of sample text is opened at Google Drive. All files, including folders, are managed by file i D, which is not the file name. All file ideas are different, so the files with the same file name can be existing in Google Drive because each file I d is different by this. When the file is retrieved by the file name, the method of get files by name is used. Files retrieved by this method is an iterated her. Each object can be retrieved by the method of next. In this case, the file with the file name of sample text is only one in Google drive, so the method of next is used. Once the retrieved file is converted to blob and the content is retrieved by the method of get data as string, you can see the content at Logger Log. Next, create a text file. It's very simple. If uses the method of create file at update a text file, opened the text file and update the content using the method of set content by this you can see the updated content at Logger Log. Also, you can create an update. See SV data using these scripts. These sample scripts are three of a lot of samples. Also in the class of Dr App, there are a lot of methods. So when you check the manual, various methods can be seen. Each method will be useful for you. 13. Intermediate Level 2: Move folder and Search files: here, I would like to talk about Move folder of files. This is also one of important methods in the case of the use of class drive app in order to move the folder of a file if uses this flow when you use this script, please set the file name. You want to move the folder and the destination folder name at first opened the file and retrieve the parent folder, and it retrieves the destination folder. Using the method of get folders by name, it uses the method of next. Because theon object retrieved by get folders by name is Theis operator. Then add the destination folder to the file as the parent folder and removed the original folder from the file. At Google Drive, a file can have several parent folders, so if the original folder is not removed, the file is existing in two folders simultaneously. Please be careful this here. I would like to talk about search files in Google Drive using Google App Scripture. This is also one of important methods. When it creates applications, there are sometimes the cases which surge files in this section. I would like to talk about the method for searching files in Google Drive using Google App Scripture In order to search files, it is required to know about the query for searching in this sample. As the search query title contains sample is used. This means that it searches files including sample in the file name. The object retrieved by the method of search files is theis operator. So please retrieve the values using the method of next. These are sample queries. You can search only text files files in the specific folder and files in trash box. There are various kinds of queries. Please check the document. Here. There is an important point. The class drive up is based on Dr A. P I V two. So each parameter is required to be used for Dr A. P I. V two. Please be careful. This This is the references which were used at this presentation 14. Intermediate Level 3: How to use Web Apps: at the intermediate level three. I would like to talk about how to use Web APS using Google App Scripture here. I would like to talk about how to use Web APS using Google App Scripture. When if uses Web ABS Google AB script can be used from outside. For example, it can run Google AB script using Curl Command on your local PC and Web APS can also output HTML. By using this, you can make users upload and download files for Google Drive about the applications for uploading and downloading files. I would like to talk about them at advanced level here. I would like to talk about the basic use of Web ABS. The method of deployment of Web APS is very simple at first on the script editor from Menu Bar, Click, Publish and Select Deploy as Web APS. By this, this window is opened for this. Please input the version and select me, which his own email address and anyone even anonymous. In this setting, all users can access to the script, and the script is run by you, who is owner? But don't worry. Web APS uses only two functions. Those are do get and do post when Web APS is called by Get Method do Get is run. When Web APS is called by post Method Do Post is run here. There are one important point when Web apps is deployed. If you modify the script of Web ABS, please redeploy as new version again. By this, the latest script is reflected to Web APS. If Webb APS is not redeployed as new version, the modified script is not reflected to Web APS. Please be careful this here. Let's create a sample script and deploy it as Web APS and call Web APS from your local PC. The sample script for Web APS Is this in this sample? Do get is used when you call this, Please use get method. This is a very simple script. When Web apps is called, the query parameters are returned. Please copy and paste this script to the script editor and deploy Web ABS at first. Please deploy. Execute the F s and who has access to the F as me and anyone, even anonymous, respectively. When you access Web APS by your browser, you can see this result on your browser. Furthermore, when the sample curl is used. The same result can be also retrieved. At the first condition, Web APS was deployed as me and anyone, even anonymous. There are five conditions in total for Web APS like this. Execute the F s means the user who runs the script When Web APS is called. In the case of me, the script is run as owner of Web ABS. In the case of user, accessing the Web of the script is run as each user who access to Web ABS. When execute the F S is me. When Web apps is deployed, it is required to authorise the scopes. When execute the F S is user accessing the Web. When each user accesses to Web APS, it is required to authorise the scopes. Next, who has access to the F means? The users who can access to Web ABS? In the case of only myself, only owner can access in the case of anyone and anyone, even anonymous anyone can access. But in the case of anyone, although anyone can access, each user is required to log into Google. On the other hand, in the case of anyone, even anonymous, anyone can access to Web APS without Log into Google. A sample situation when the script of Web APS download a file from U R L If the condition five is used, the downloaded file can be saved in each users. Google drive by using Web ABS, various applications can be created. I summarized about Web APS, Atget Hub. You can see it from this u R l This is the references which were used at this presentation . 15. Advanced Level: File uploader to Google Drive: here as advanced level, I would like create applications here. Here, create three applications. I selected these three themes. The reason that I selected themes is thes. I am often asked about the up loader and downloader of files using Google App Scripture. And there are the methods which cannot do using the existing Google a P I. It creates one of them here, So I selected these themes. At first, I would like to introduce about file uploaded to Google Drive at first, create an application of file uploaded to Google Drive. In this situation, I would like to use Web APS at first. Let's think of the flow of this application here. Use input tag of HTML as the user interface for selecting files in local PC. This HTML can be put to your site and send the selected file to Web APS at Web ABS. The file blob cannot be directly sent, so in this case it sends the file as the string convert the file to B A s E 64 values using JavaScript, send the string values to Google and convert the string values to the file using Google app Scripture, The image of this flow is this. This application can be achieved by Web APS. In this application, Web apps is used. So the script of Google AB script is like this e parameter data is the converted B A s E 64 value. In this script convert the B A s E 64 value to the Blob and created as a file to Google Drive. When the process was finished in order to send the status code of 200 null is returned. When you use the script, please copy and paste this to the script editor and please deploy this as Web abs at the condition execute the F S n who has access to the F Army and anyone even anonymous, respectively. This is a HTML and JavaScript for uploading the selected file. This HTML is independent from Google, For example, you can put this to your site and you can use the script at local PC. In this script, the selected file is converted to the B A s E 64 data, which is the string and sent to Web ABS. You can see the u R L of web abs in this script. These Google AB script and HTML script are very simple. So how about modifying them as the practice? For example, it changes Theo Html design and add the error process. 16. Advanced Level: File downloader from Google Drive: as the second theme, I would like to introduce about file downloader from Google Drive here. Also, I would like to use Web ABS. Of course, there are several methods for this situation about them I would like to introduce at other class here I use Web APS as the server for returning files. And as the client, I would like to use Python script. It supposes that it uses Web APS from outside. At first, let's think of the flow of this application using Python script, which is the client send file I d from the client application at Web app side. Get the file I d. From the client and returned the file with the file I d open the file and converted to bite array and return the value to the client at the client Convert the return value to the file . This works like an A P I in this application. Also, Web Epps is used. So the script of Google APP script is like this e parameter I d o s. The file I d in this script, get the file I d and open the file of file I d and create an object including the value converted to the bite array and the file name and the mime type. It returns this object when you use the script, please copy and paste this to the script editor. And please deploy this as Web ABS at the condition. Execute the F S n who has access to the F Army and anyone, even anonymous, respectively. This is a Python script for the client's side. This script calls Web maps and retrieve the values from Web ABS. Please set the U R L of Web APS and file I D. At first call Web apse with the file i d. When the values are returned from Web APS, the bite array is converted to the file and saved and show the file information. These Google AB script and Python script are very simple. So how about modifying them as the practice? For example, it recreation the script to a command line tool and add the error process 17. Advanced Level: Original APIs: here create three applications. I selected these three themes. The reason that I selected themes is thes. I am often asked about the up loader and downloader of files using Google App Scripture. And there are the methods which cannot do using the existing Google A P I. It creates one of them here, so I selected these themes. At first, I would like to introduce about file uploaded to Google Drive here. I would like to create an original A P I as an application create the A P I, which returns the data range from spreadsheet. This is one of methods which cannot achieve using the existing Google A P I at sheets AP I . All values can be retrieved, but the data range cannot be retrieved. If such method is created, it will be useful. Let's think of the flow of this application at Web absinthe. It is required to retrieve the information of spreadsheet I D and the sheet that users want the data range when the information can be retrieved, it returns. The data range retrieved using spreadsheet in this application used to get because the data size is small for this situation. When you use the script. Please copy and paste this to the script editor and please deploy this as Web abs at the condition execute the f s n who has access to the F army and anyone, even anonymous respectively. Let's think of the flow of this script e parameter I d and e parameter. She'd name our spreadsheet I d and she name respectively. At first create an object which is used for the result an open spreadsheet and retrieve the data range and the index of last row and last column. Those values are put in the object. Then the created object is returned as Thea output. In this case, if the spreadsheet I d and sheet Neymar not existing, the error is returned using try catch. This is a sample curl and result After the Web apps was deployed, you can use this curl command. When you run this curl command, you retrieve the result like this. This is a very simple method. So how about modifying this as the practice? For example, it adds more methods. Lastly, in this class, the basic usage and sample situations were introduced by three levels which are basic level , intermediate level an advanced level for each level. The methods, which are often seen and used, were used as samples. I think the tool that Google AB script is very useful for various scenes. So I would like to keep study Google app Scripture. If I have a chance to have new more class, I would like to do it. I hope this class gives the good change for your life. Thank you.