Google Drive — Move
Google Drive — Move
Section titled “Google Drive — Move”Type: googledrive-move · Package: Google Drive v1.0.5 · Output: Dictionary<string,object>
Moves a file or folder to another Drive folder. Unlike Copy, it is the same item (it keeps its ID, link and permissions); only its location changes. It is the natural way to mark something as processed: move it from “Inbox” to “Processed”.
How it works
Section titled “How it works”Looks up the item’s current folders and leaves it only in folderId: it is removed from every folder it was in. Moving a folder also moves its content.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | ID of the file or folder to move. |
folderId | string | — | Destination folder ID (root for the root of My Drive). |
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: moved["parents"] now holds the destination ID.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'id' is required. | id is empty or its expression returned null. |
'folderId' is required. | folderId 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 — Move id = file["id"] folderId = processedId → output: movedRelated activities
Section titled “Related activities”- Google Drive — Copy — copy instead of move.
- Google Drive — Create folder — create the destination folder.
- Google Drive — List files — find the IDs.
- All Google Drive activities