Google Drive — Rename
Google Drive — Rename
Section titled “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).
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | File or folder ID. |
name | string | — | New name, with its extension where it applies. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanGoogleDriveSession | — | Session from Google Drive — Connect. Inside Connect’s body it is inherited and you can leave it empty. |
Output
Section titled “Output”Returns a Dictionary with the item’s updated metadata (id, new name, modifiedTime…).
Common errors
Section titled “Common errors”| Message | Cause 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. |
Example
Section titled “Example”Google Drive — Connect credential = credential("drive-operations") └─ body: Google Drive — Rename id = file["id"] name = "PROCESSED_" + file["name"] → output: renamedRelated activities
Section titled “Related activities”- Google Drive — Get info — see the item’s data.
- Google Drive — Move — move it to another folder.
- Google Drive — Copy — duplicate it.
- All Google Drive activities