'Retrieve file owner email of Google Drive files

I’m looking to use Drive API v3 with appscript to look up the owners. created date, current sharing settings of drive files by a list of file ids (listed in column A) and print the output to Column B.

Is this possible?



Solution 1:[1]

If you are planning to use Apps Script you can use the following function:

function myFunction() {

var spreadsheetId = "###";
var ss = SpreadsheetApp.openById(spreadsheetId);
console.log(ss.getOwner().getEmail())

}

Please note that the code would give you error messages if you do not have access to the files. This is expected due to security reasons. Sharing permissions would need to be at least for anyone within the domain to have access to the file.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fernando Lara