Skip to main content

Copy file

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Copy file action copies a file to a specified destination folder. This action allows you to duplicate files across different locations in your file system as part of your automation workflow.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

File to copy

Enter a file path, or choose a variable containing a file path

-

Yes

Use the 'Get files in folder' action to populate a variable with a list of files

Destination folder

Choose or enter the full path of the destination folder for the copied file(s)

-

Yes

-

If file exists

Specify what to do if a file with the same name already exists in the destination folder

Overwrite, Do nothing, Rename

Yes

-

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action produces a variable that stores the path of the copied file. The output variable can be used in subsequent actions to reference the newly created file.


Using Variables in Conditions

Parameters marked with {x} icon indicate that you can use variables in these fields. You can insert previously defined variables by clicking on the {x} button next to the input field. For example, you could use a variable containing a file path for the "File to copy" parameter or a variable containing a folder path for the "Destination folder" parameter.


Notes

  • Ensure that the source file exists before attempting to copy it.

  • Make sure you have proper permissions to access both the source file and destination folder.

  • The "If file exists" option determines how the action handles naming conflicts:

    • "Overwrite" will replace any existing file with the same name.

    • "Do nothing" will skip the copy operation if a file with the same name exists.

    • "Rename" will add a number suffix to the filename to create a unique name.

  • If the destination folder doesn't exist, the action will fail with an error.

Did this answer your question?