Skip to content

Google Drive — Get info

Type: googledrive-get-info  ·  Package: Google Drive v1.0.5  ·  Output: Dictionary<string,object>

Gets the metadata of a file or folder from its ID: name, type, size, dates, the folders that contain it and its link. Use it when you already have the ID and want to check its data before acting, for example whether it still exists or changed since the last run.

Queries Drive by id. It only reads: nothing is changed. It also returns items that are in the trash (with trashed = true).

ParameterTypeDefaultDescription
idstring—File or folder ID.
ParameterTypeDefaultDescription
sessionZoanGoogleDriveSession—Session from Google Drive — Connect. Inside Connect’s body it is inherited and you can leave it empty.

Returns a Dictionary with the item metadata: info["name"], info["mimeType"], info["isFolder"], info["size"] (bytes; null for folders and Google documents), info["webViewLink"], info["modifiedTime"], info["parents"], info["trashed"]…

MessageCause and fix
'id' is required.id is empty or its expression returned null.
No Google Drive session available. Provide 'session' from a googledrive-connect activity, or place this activity inside the Connect activity's body …The activity is outside Connect’s body and received no session. Move it inside the body or pass the saved session.
The service drive has thrown an exception. HttpStatusCode is NotFound…The ID does not exist or the account has no access. To check whether a file exists without stopping the process, wrap it in Try / Catch.
The service drive has thrown an exception. HttpStatusCode is …Google rejected the call: unknown ID or no access, expired token or quota exceeded. See Google API errors.
Google Drive — Connect credential = credential("drive-operations")
└─ body:
Google Drive — Get info id = fileId → output: info
If condition = eq(info["isFolder"], false) && eq(info["trashed"], false)
└─ then:
Log message = info["name"] + " — " + info["size"] + " bytes, modified " + info["modifiedTime"]