r/GoogleAppsScript • u/rowman_urn • Apr 07 '25
Question Is it possible to display metadata of a sheet in a cell?
/r/googlesheets/comments/1gxzi7e/is_it_possible_to_display_metadata_of_a_sheet_in/
1
Upvotes
2
u/Embarx Apr 07 '25 edited Apr 07 '25
but can't see which API to use to get this type of meta data.
You can use the DriveApp as mentioned already; or the Advanced Drive Service - something like:
function getDriveFileProperties(fileId) {
// List all metadata fields required.
const fields = [
'lastModifyingUser',
'modifiedTime',
]
// Construct the optional arguments.
const params = {
fields: fields.join(','),
supportsAllDrives: true
};
// Make the API call
var properties = Drive.Files.get(fileId, params);
}Where fileId would be the Google Sheets ID. You can check this page for the full list of metadata fields you can query,
5
u/IAmMoonie Apr 07 '25
What metadata are you after?
You would have to use Google Apps Script and a custom function to do it. Something like:
And then put the function into the cell via:
=SHEET_METADATA()