Skip to main content
Roberty Studio
RPAFiles

Move File on Drive

Move File on Drive

Moves a file to a new destination, which can be on a different drive.


Options​

Drive connection​

Select the Connection action set up in the flow.

Source drive​

Enter the name of the drive the file is currently on. Leave it empty to use "My Drive".

File current path on Drive​

Enter the full path of the file to move, including its name and extension, for example /Documentos/relatorio.pdf.

File ID​

Enter the file ID in Google Drive. If provided, this ID is used instead of the path. You can get the ID, for example, from the id return of the Get file by name action.

Destination drive​

Enter the name of the drive the file will be moved to. Leave it empty to use "My Drive".

Destination folder path​

Enter the path of the destination folder, for example /Arquivo/2026.

Destination folder ID​

Enter the destination folder ID in Google Drive. If provided, this ID is used instead of the destination path. You can get the ID, for example, from the id return of the Get folder by name action.

Only search destination in "Shared with me"​

Turn this on when the destination folder was shared with the connected account. The first folder of the new path is then looked up in Shared with me, for example /Client folder/2026. Together with the Only search in "Shared with me" option, it lets you move items from My Drive into a shared folder and back. Default: off.

Create destination path if it doesn't exist​

When enabled, it automatically creates the folders of the destination path that do not exist yet. Default: enabled.

Only search in "Shared with me"​

Turn this on when the file was shared with the connected account instead of owned by it. The first part of the path is then looked up in Shared with me: /report.pdf points to a file shared directly with the account, and /Client folder/report.pdf to a file inside a shared folder. Default: off.

Returns​

Javascript code​

js
actions["action-id"].newParentId // identifier of the new parent folder (Text)

Field selection​

  • newParentId — unique identifier of the destination parent folder (Text)

Rules and Conditions​

  • The Drive connection field is required. Also fill in File current path on Drive or File ID, and Destination folder path or Destination folder ID; if either is missing, the robot stops the run with an error.
  • When File ID is provided, the File current path on Drive, Source drive and Only search in "Shared with me" fields are not used.
  • When Destination folder ID is provided, the Destination folder path, Destination drive, Only search destination in "Shared with me" and Create destination path if it doesn't exist fields are not used.
  • This action supports moving files between different drives.
  • If Create destination path if it doesn't exist is disabled and the destination does not exist, the robot stops with an error.
  • With Only search in "Shared with me" on, the Source drive field is not used to find the first part of the path.
  • With Only search destination in "Shared with me" on, the Destination drive field is not used to find the first folder of the new path, and the new path must include at least the shared folder — / stops the run with an error.
  • Create destination path if it doesn't exist does not create the shared folder: if the first folder of the path is not in Shared with me, it is created in the selected drive.
  • On shared items, what the robot can do depends on the permission the owner gave the connected account. Without edit permission, Google Drive refuses the operation and the robot stops the run with an error.