Skip to content

Google Drive — Rename

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

Changes the name of a file or folder. The item keeps its ID, location, link and permissions; only its name changes. Useful to normalize names or add a status suffix (_processed).

Sets name exactly as given: it does not keep the extension on its own, so include it if the file has one (Final report.pdf). Drive allows duplicate names, so it does not fail if another item in the folder already has that name.

ParameterTypeDefaultDescription
idstring—File or folder ID.
namestring—New name, with its extension where it applies.
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’s updated metadata (id, new name, modifiedTime…).

MessageCause and fix
'id' is required.id is empty or its expression returned null.
'name' is required.name 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 …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 — Rename id = file["id"] name = "PROCESSED_" + file["name"] → output: renamed