Rename a file in drive
Rename a file in drive
Renames an existing file in Google Drive.
Options
Drive connection
Select the Connection action set up in the flow.
File path on Drive
Enter the full path of the file to rename, including its name and extension, for example /Documentos/relatorio_antigo.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.
New name
Enter the new name for the file, including the extension, for example relatorio_2026.pdf.
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.
Drive name
Enter the name of the drive to reach. Leave it empty to use "My Drive".
Returns
Javascript code
actions["action-id"].name // new file name after the rename (Text)
Field selection
- name — new file name after the rename (Text)
Rules and Conditions
- The Drive connection and New name fields are required. Also fill in File path on Drive or File ID; without either, the robot stops the run with an error.
- When File ID is provided, the File path on Drive, Drive name and Only search in "Shared with me" fields are not used.
- The given file must exist in Google Drive.
- The new name must include the file extension.
- With Only search in "Shared with me" on, the Drive name field is not used to find the first part of the path.
- 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.