Skip to content

Copy File From Source To Destination Function: copyfile

The Copy File From Source to Destination function copies a file from a specified source path to a destination path. The function checks for overwrite permission and stores the operation’s success or failure (true/false) in the variable defined in the Element Key field.

Example: Suppose you want to copy a file from the folder C:\Projects\Source to the folder D:\Backup\Destination. You also want to overwrite the file if it already exists in the destination.

Steps to Configure:

  1. Select Set a Variable Value from the Action dropdown.
  2. In the Element Key field, enter the name of the variable that will store the result of the operation (e.g., CopyStatus).
  3. Click Form to open the configuration form.
    • From the dropdown, select Functions and choose Copy File From Source To Destination.
    • Select the Operation as copy.
    • Provide the following details:
      • Source: C:\Projects\Source\file.txt (the path of the file to be copied).
      • Destination: D:\Backup\Destination\file.txt (the target path where the file will be copied).
      • Overwrite: true (allows the destination file to be replaced if it already exists).
  4. Click Save.
scrn-copy-file-to-source-to-destination-tabular-view
Tabular View
scrn-copy-file-to-source-to-destination-card-view
Card View

Outcome on Execution:

  • If the file is successfully copied from the source to the destination path, the variable (e.g., CopyStatus) will store true.
  • If the copy operation fails (e.g., due to incorrect file paths or lack of permissions), the variable will store false.
  • You can reference this variable in later steps using syntax ${Variablename} (e.g., ${CopyStatus}).

Back To Top