CopyFile

The CopyFile copies an existing file to a new file.

Screenshot

Ports

The CopyFile component exposes the Control In, Control Out, and Data In ports by default.

Port Description
ControlIn Must be connected to the Control Out port of one or more components.
ControlOut Can be connected to the Control In port of another component or the default end component.
Data In The Copy File component exposes the following Data In ports by default:
sourcefilePath: specifies the location of the file to copy (string)
destFilePath: specifies the location of the new file (string)
Note: You cannot provide a directory or the path of an existing file in the destFilePath Data In port
Override: specifies if Intellibot can overwrite an existing file, with the same name as the new file, in the destination location (Boolean). By default, the Boolean data type value is “False”. Therefore, the existing file is not overwritten. If you want to overwrite the existing file, you can change the default Boolean value to “True”.

Properties

To edit the properties of the CopyFile component, in the Properties window, change the required property. You can edit the following properties.

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is performed.
Delay Before Execution Specifies the wait time (in seconds) before the action is performed.

Example

Let us consider an example.

Screenshot

To add text to a file:

  1. In the Toolbox, expand Utilities and expand File.
  2. Drag the CopyFile component and drop it on the Design surface.
  3. Double-click sourcefilePath box and enter the location of the file to copy.
  4. Double-click destFilePath box and enter the location of the new file.

    Note

    You can override the existing data source for both the sourcefilePath and the destFilePath Data In ports. To override the existing data source:

    • Right-click the required Data In port.
    • Click Override and change the data source.
      To learn more about overriding the data source of the data port, refer the Override section.
  5. To override the default Boolean value of the overwrite Data In port, if required:

    • Right-click the overwrite box.
    • Click Override.
      The PORT PROPERTIES dialog box is displayed.
    • In Read Data From, select Static.

    Note

    In Read Data From, you can select Connection or Variable instead of Static. To learn more about the Connection or Variable data source override options, refer the Override section.

    • In Static Value, click the drop-down arrow and select “True”.
    • Click OK. The Design surface displays the process flow.
  6. Connect all the control ports in the activity.

  7. In the toolbar, click Run.