News

Drive API v3 has been released to Advanced Google services

Recently, when Drive API is enabled at Advanced Google services with the script editor, Drive API v3 is automatically used. In the official document, Drive API v3 has already been used. Ref In the current stage, the users can select V3 and V2.

When Drive API v3 is used with Advanced Google services, the following advantages can be considered.

  1. Drive API v3 can be used with only the scopes for Drive API without adding a scope https://www.googleapis.com/auth/script.external_request.
  2. The files and folders can be searched by the search query of createdTime. Ref

References:

Embed content as a full page in new Google Sites

By updating on May 25, 2022, the content got to be able to be embedded as a full page in the new Google site. Ref. This is very good news for me.

For example, with this update, the Web Apps created by Google Apps Script can be published by embedding to the Google site as a full page. By this, the URL of the Google site, and Google Analytics can be used. I have already changed my Web Applications. You can see them at https://tanaikech.github.io/webapps/

Updating Script Editor of Google Apps Script

On April 13, 2022, “Additional functionality for the Apps Script Integrated Development Environment (IDE) Script Editor” has been reported.

They say as follows.

We’re now adding several new features to the IDE to help achieve functional parity with the legacy IDE experience. These features are:

  • Script Properties
  • Add-on Testing
  • Time Zone Setting
  • Rhino Debugging

By this update, I believe that the script editor will be more useful.

On January 19, 2022, 2 Classes of 'CellImageBuilder' and 'CellImage' have been added to Spreadsheet Service

On January 19, 2022, 2 classes of CellImageBuilder and CellImage have been added to the Spreadsheet Service.

Unfortunately, in the current stage, it seems that the image manually put to a cell without using the URL cannot still be retrieved.

  • When an image is manually put from URL and Google Drive to a cell, this image cannot be retrieved.
  • When an image is put using setSourceUrl method with a script, this image and URL cannot be retrieved.

I would like to expect to resolve these in the future update.

[Fixed] Google Apps Script Web App HTML form file-input fields not in blob compatible format

After V8 runtime was released, there was a bug that when the file is sent from HTML form to Google Apps Script side using google.script.run, the file blob was the invalid data.

From Apps Script Pulse by Martin Hawksey, it was found that the invalid blob of sending the file of HTML form to Google Apps Script side using google.script.run has finally been resolved. In this case, this script can be used with V8 runtime.

Google Cloud Champion Innovators

Google Cloud Innovators

Regardless if you use Cloud to build, modernize, train, teach, or even for fun - in our eyes you are an Innovator. The Innovators program is here to accelerate your learning and growth on Google Cloud, and to recognize you for the contributions you make to the broader Cloud community.

Champions

We recognize all these individuals for being at the top of their game technically - and for going further to inspire, invigorate, and challenge the Google Cloud community and our product teams by sharing their technical knowledge and contributing to conferences, open source projects, forums, blogs, workshops, community events, and social media.

A Bug of New IDE about Time Zone of Google Apps Script project was removed

Gists

I had confirmed a bug of new IDE about the time zone of Google Apps script project. When I created new Google Apps Script project using new IDE, the time zone of GAS project is always America/New_York. In my area, it’s Asia/Tokyo. The time zone can be confirmed at appscript.json.

So, I had reported this issue to Google issue tracker. Ref After I posted this, I had also confirmed this issue at Stackoverflow. Ref

Meet the Google Workspace Developer Experts

Original post

Superheroes are well known for wearing capes, fighting villains and looking to save the world from evil. There also are superheroes that quietly choose to use their super powers to explain technology to new users, maintain community forums, write blog posts, speak at events, host video series, create demos, share sample code and more. All in the name of helping other developers become more successful by learning new skills, delivering better apps, and ultimately enhancing their careers. At Google, we refer to the latter category of superheroes as Google Developer Experts or “GDEs” for short.

Drive API got to be able to create Google Apps Script project again

Gists

I have reported “Drive API cannot create Google Apps Script project no longer”. Ref About this, I had reported the future request. Ref Today, I could confirm that the Google Apps Script project of the standalone type got to be able to be created by multipart/form-data using Drive API. This is a good news for me. By this, the following 2 patterns can be used from now.

Pattern 1:

  1. Create new standalone GAS project by Apps Script API.
  2. Put the local script to the created GAS project by updating the project with Apps Script API.
  3. Move the GAS project from the root folder to the specific folder using Drive API.

In this pattern, 3 API calls are required.

Specification of Files: copy in Drive API was changed

I noticed that the specification of Files: copy in Drive API was changed. About the method of Files: copy in Drive API v3, this method could be used with the scope of https://www.googleapis.com/auth/drive.readonly until July 5, 2020. But I confirmed that in the current stage, the scope is required to be changed to the following scopes.

  • https://www.googleapis.com/auth/drive
  • https://www.googleapis.com/auth/drive.file
  • https://www.googleapis.com/auth/drive.appdata
  • https://www.googleapis.com/auth/drive.photos.readonly

Please be careful this.

Transfer of owner of files got not to be able to be used with batch requests of Drive API

At 15, June 2020, I have reported the transfer of owner of files got to be able to be achieved with batch requests of Drive API. Ref And also, yesterday (06, July 2020), I could have confirmed that this could be worked. But, now (07, July 2020), the following response is returned.

{
  "error": {
    "errors": [
      {
        "domain": "global",
        "reason": "invalidSharingRequest",
        "message": "Bad Request. User message: \"You can't yet change the owner of this item. (We're working on it.)\""
      }
    ],
    "code": 400,
    "message": "Bad Request. User message: \"You can't yet change the owner of this item. (We're working on it.)\""
  }
}

I hope this situation is resolved in the near future.

Transfer of owner of files got to be able to be achieved with batch requests of Drive API

Today, I could confirm that the transfer of owner of files got to be able to be achieved with batch requests of Drive API. When I had tested this at January 31, 2020, an error of there is no function to change the owner of this item yet (currently under development) had occurred.

But today, I could confirm that this got to be able to be achieved by the batch requests. By this, the owner of a lot of files can be transferred by reducing both the process cost and the quota cost.

Managing Shared Drive using Drive Service of Google Apps Script

Gists

When the method of “Files: list” in Drive API v3, the official document of includeItemsFromAllDrives and supportsAllDrives says as follows.

Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. (Default: false)

Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. (Default: false)

Drive API cannot create Google Apps Script project no longer

Gists

Today, I noticed that new Google Apps Script project of the standalone script type cannot be created by the method of Files: create in Drive API. From now, in order to manage the Google Apps Script project, only Google Apps Script API is required to be used. By this, the following issues are brought.

  • When the new standalone GAS project is created in the specific folder by uploading the local script, the following flow is required to be run.
    1. Create new standalone GAS project by Apps Script API.
    2. Put the local script to the created GAS project by updating the project with Apps Script API.
    3. Move the GAS project from the root folder to the specific folder using Drive API.

From now, 3 API calls are required to be used like above. By the way, this had been able to be achieved by one API call of the method of files.create in Drive API before.

V8 Runtime was added to Google Apps Script at February 7, 2020

Gists

In my environment, at February 7, 2020, when I opened the script editor of Google Apps Script, the following notification could be seen.

By this, I could notice that finally, the V8 Runtime has already been added to Google Apps Script. I think that this will be also the great news for a lot of users including me.

The detail of V8 Runtime can be seen at https://developers.google.com/apps-script/guides/v8-runtime.

Specification of Google Apps Script Project was Changed at April 8, 2019

Gists

At April 8, 2019, the specification of Google Apps Script Project was changed. Various specification was changed. Please see the detail at Google Cloud Platform Projects. Here, I would like to introduce one change which might be useful for users. The official document says as follows.

When you enable an advanced service for your script project in the Apps Script editor, it is automatically enabled in the default GCP project when the script project is saved.