Copy File

This activity helps the user to copy file from the respective location to another location
specified with it. We can also copy read-only files from one location to another.
We can also copy a file from a shared folder, granted we have access to it.

Technical Reference

 

 

 

 

 

 

 

 

 

 

 

   INPUT

From: Specify the file path of the file to be copied. You can also select the file manually by selecting the three dots adjacent to the path. This accepts only “String” datatype.

OverWrite: Check this box if you want to overwrite a file, if it is already available in the path that you have chosen.
By default, it is unchecked. This means if the zipped file which we are trying to save to location is already available there, it wouldn’t get saved in that location.

To: Specify the file path to where the selected file needs to be pasted. You can also select the file manually by selecting the three dots  adjacent to the activity. This accepts only “String” datatype.

 

 

 

 

 

   

    MISC

Display Name: Displays the name of the activity. The activity name can also be customized which will help in troubleshooting.

SkipOnError: Specify the Boolean value as “True or False.”
True: Continues to execute the workflow irrespective of any error thrown.
False: Stops the workflow if it throws any error.
None: If the option is specified as blank, by default the activity will perform the “False” action.

Version: It specifies the version of the FS automation feature in use.

 

 

 

     OUTPUT

Result: It helps to view the execution state of the activity. It returns the values in Boolean format.
True: It indicates that the activity has been executed successfully without any error.
False: It indicates that the activity has been unsuccessful due to some unexceptional error thrown.

*Represents mandatory fields to execute the workflow

 Let’s see how this activity works,

1.      Create a new solution or use an existing solution.

2.      Drag and drop a “Copy file” activity to the workflow.

3.      Double click on the activity and enter the path from where the file has to
be copied in the “from” section and enter the path where the file has to
be pasted in the “to” section. Here we are going to copy the file
“Copy folder.docx” from the Documents folder to the desktop.


 

4.      Declare and assign a new variable in Result tab. This is done to see
the success state of the activity. Here it is “CF”. This is in “Boolean” datatype.
 

5.      Drag and drop the "WriteLog" activity next to the "CopyFile" activity to
observe the success state of the activity.

a.      Enter the input string. Here, I'm using "CF," which was declared in the "Result"
 parameter of the "CopyFile" activity. The reason for providing ".Tostring" is to
convert the “Boolean”
datatype to “String” datatype.

b.     Here it “CF.ToString”

6.      Execute the workflow.

Click here to see how the activity works in a workflow.