https://spreadsheet.dev/automatically-convert-excel-spreadsheets-to-google-sheets-using-apps-script
On the page above, Drive API is introduced to convert excel file to Google Sheet
let blob = excelFile.getBlob();
let config = {
title: "[Google Sheets] " + excelFile.getName(),
parents: [{id: excelFile.getParents().next().getId()}],
mimeType: MimeType.GOOGLE_SHEETS
};
let spreadsheet = Drive.Files.insert(config, blob);
I've been checking Google Drive API's documentation and references, but couldn't find anything regarding Drive.Files
and Drive.Files.insert
. I am seeking the right documentation so I can learn to use these interfaces myself.
Unfortunately, it seems that the detailed document of Drive API of Advanced Google services is not been officially published. But, in your situation, I thought that the document at the autocomplete of the script editor of Google Apps Script might be useful.
When the script editor of Google Apps Script is used, you can use the autocomplete of each method. In this case, when Drive API is enabled at Advanced Google services, this autocomplete can be also used for the methods of Drive API. When this is used, the documents of each method can be seen as follows. As a sample, Drive.Files.insert
is used.
This completion includes an explanation of the method. In the case of Drive.Files.insert
, it is found that it is Insert a new file.
and the arguments are
resource: Drive_v2.Drive.V2.Schema.File
mediaData: Blob
optionalArgs: Object
, respectively. From this, it is found that this is Drive API v2. And, Drive_v2.Drive.V2.Schema.File
is returned. This can be seen at here.
I thought that this document of the autocomplete with the script editor might be useful for understanding how to use Drive API at Advanced Google services.